EtText: Documentation: Links in EtText

EtText Documentation (version 1.1) | [ Back | Forward | Index | All In One ]

## Links in EtText As well as the standard <a href=url>...</a> link specification used in HTML, EtText will automatically add href tags for URLs and email addresses that occur in the text. In addition, EtText supports its own link format, as follows. The basic concept is of a word or "quoted set of words" followed by a link label in [square brackets], like this: "this is a link" [label]. The href used in the link is then defined at another point in the document, as an indented line like this:
      label: http://url
Text and markup can be enclosed in the quotes, everything quoted will become part of the link text. Single words or HTML tags do not need to be quoted, so
      <img src="/license_plate.jpg" width="10" height="10"> [homepage]
will work correctly. ### Glossary Links EtText also supports a concept called glossary links; if you define a link, the name of that link will automatically become a href if enclosed in quotes. For example:
      [Justin Mason]: http://jmason.org/
will mean that any occurrence of the name "Justin Mason", in quotes, in any EtText content chunk or file in the site, becomes a link to that address. In addition, if the link definition is preceded with `Auto:`, the quotes are not required, and any occurrence of the word (with or without quotes) will become a link.
      Auto: [WebMake]: http://webmake.taint.org/
These links are stored in the WebMake cache file, if WebMake is being used. Alternatively, if you are using the Text::EtText modules yourself, provide an implementation of the Text::EtText::LinkGlossary interface to support this. Quoted bits of text that do not map to an entry in the glossary are not converted to links (unless they're followed by a square-bracketed link-label reference). URLs, such as http://webmake.taint.org/ , and email addresses, such as jm@nospam-jmason.org, are automatically converted into links to that same address. ### Blocking EtText Link Interpretation To block interpretation as a link, replace square brackets with the HTML entities &etsqi; and &etsqo;, which map to [ and ] respectively; replace quote characters, ", with two apostrophes, ''. If that doesn't do the trick, wrap the entire section of text with the <!--etsafe-->...<!--/etsafe--> tags.

EtText Documentation (version 1.1) | [ Back | Forward | Index | All In One ]