Abnaxos / markdown-doclet

A Doclet that allows the use of Markdown in JavaDoc comments.
GNU General Public License v3.0
318 stars 40 forks source link

Add support for inline tags #6

Closed Abnaxos closed 11 years ago

Abnaxos commented 11 years ago

Inline tags are currently just left alone, as they don't interfere with Markdown syntax, usually. There is, however, an exception to this: If the extension SMARTS is enabled, it will break some links, e.g. in {@link String#format(String, Object...)} the three dots for varargs will be translated into a Unicode ELLIPSIS ('\u2026'), which is just plain wrong.

To work around this, we need to introduce a way to remove inline tags for rendering and re-insert them afterwards. While we're at it, adding tag renderers to inline tags may also enable some neat features. E.g., we could add an option to automatically add shortened labels to links, i.e. translate {@link String#format(String, Object...)} into {@link String#format(String, Object...) String.format()}.

A possibility to do this is to use Doc.inlineTags() replacing any non-text tags with an escape sequence ("\027<index>;"), process the markup and re-insert the tags at the escape sequences after optionally rendering them using a TagRenderer.