wincent / docvim

Documentation generator for Vim plug-ins
MIT License
25 stars 0 forks source link

<Leader> gets eaten in Markdown output #39

Closed wincent closed 6 years ago

wincent commented 7 years ago

Given source like this:

" Shortcut mappings are provided to start an |:Ack| search (<leader>a) or to
" search for the word currently under the cursor (<leader>s).

We output Vim doc:

Shortcut mappings are provided to start an |:Ack| search (<leader>a) or to
search for the word currently under the cursor (<leader>s).

And markdown:

Shortcut mappings are provided to start an <strong>[`:Ack`](#user-content-ack)</strong> search (<leader>a) or to search for the word currently under the cursor (<leader>s).

When that Markdown gets HTML-ified on GitHub, it shows up as:

<p>Shortcut mappings are provided to start an <strong><a href="#user-content-ack"><code>:Ack</code></a></strong> search (a) or to search for the word currently under the cursor (s).</p>

GitLab does the same, stripping the unrecognized tag right out as part of sanitization. Bitbucket does not, but it is a mess in other ways.

So, we should deal with this using either a whitelist of HTML tags that we'll let through, and escape everything else.