diff --git a/doc/userguide.html b/doc/userguide.html index 8c22cf65..fd5eed11 100755 --- a/doc/userguide.html +++ b/doc/userguide.html @@ -163,7 +163,8 @@ For the quality of the information committed to the logbook, you need understand

  • in addition to the above URLs, one can enter a tag elog:<id> which references another logbook entry. The tag elog:<logbook>/<id> references a message in another logbook on the same server. The tag elog:<id>/<n> references attachment number n in a logbook entry. To reference -an attachment in the current message, one uses elog:/<n>. +an attachment in the current message, one uses elog:/<n>. An anchor inside an entry can be referenced +with elog:<id>#<anchor>.

  • the Text multi-line field, if present, may be pre-filled with a template if entries need to have a common, consistent format across the logbook (especially for HTML). There may also be a comment inserted before it to explain local rules and conventions, upload rules, etc.

    diff --git a/resources/elcode_english.html b/resources/elcode_english.html index cee6a6ff..a35fe962 100755 --- a/resources/elcode_english.html +++ b/resources/elcode_english.html @@ -133,6 +133,16 @@ for example. In order to avoid interpretation of tags, one puts a backslash "\" in front of the tag, like \[b] instead of [b].

    +

    Anchor

    + +
    An anchor can be put into an entry with +[anchor]anchor_name[/anchor]. This is equivalent to a HTML anchor like +<a name="anchor_name"></a>. +Such anchors can be referenced inside an entry with +elog:<id>#anchor_name where <id> is the ID number of +the entry (the number from the left column in the list display).

    + +

    Smileys


    Smileys, or Emoticons, are small graphical images which can be used to diff --git a/src/elogd.c b/src/elogd.c index 92166aca..c25b71cd 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -5770,6 +5770,9 @@ PATTERN_LIST pattern_list[] = { /* horizontal line */ {"[line]", "
    "}, + /* anchor */ + {"[anchor]", ""}, + {"[/anchor]", ""}, {"", ""} }; @@ -5861,7 +5864,7 @@ void rsputs_elcode(LOGBOOK * lbs, BOOL email_notify, const char *str) if (!isdigit(tmp[m])) break; - if (m < (int) strlen(tmp)) { + if (m < (int) strlen(tmp) && tmp[m] != '#') { /* if link contains reference to other logbook, put logbook explicitly */ if (email_notify) compose_base_url(NULL, base_url, sizeof(base_url)); @@ -6050,7 +6053,8 @@ void rsputs_elcode(LOGBOOK * lbs, BOOL email_notify, const char *str) /* add http:// if missing */ else if (!strnieq(attrib, "http://", 7) && strstr(pattern_list[l].subst, "mailto") == NULL && - strstr(pattern_list[l].subst, "img") == NULL) + strstr(pattern_list[l].subst, "img") == NULL && + strncmp(pattern_list[l].subst, "