typedoc2md / typedoc-plugin-markdown

A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.
https://typedoc-plugin-markdown.org
MIT License
691 stars 171 forks source link

References containing angle brackets improperly escape the angle bracket with a backslash `\` before escaping them with the HTML escape character `>` #495

Closed loucadufault closed 8 months ago

loucadufault commented 8 months ago

This came up when using this plugin alongside the plugin: https://github.com/Gerrit0/typedoc-plugin-missing-exports, which by default creates a module named <internal>. This module seems to be improperly escaped when referenced elsewhere in the typedoc, as:

### Modules

- [&lt;internal\&gt;](index._internal_.md)

which renders as:

Note that the escaping is somehow only incorrect for the closing angle bracket.

I am not sure whether this is an issue with this plugin, but I confirmed that when not using the plugin, the reference to the module is properly escaped (using the native HTML renderer).

I tried looking through the source, as far as I can tell there is the escapeChars() function that probably runs on the module name to create the reference name, but I am not sure what is then converting that to the HTML escape characters &lt; and &gt;.

tgreyuk commented 8 months ago

OK thanks - this was actually being escaped by Handlebars. Please try with typedoc-plugin-markdown@3.17.1 which contains a fix.

loucadufault commented 8 months ago

Thanks for the quick fix! Can confirm this is resolved in 3.17.0.