VimHelpBot icon indicating copy to clipboard operation
VimHelpBot copied to clipboard

Proper markdown for bracket commands

Open Abraxas-Knister opened this issue 4 years ago • 3 comments

https://www.reddit.com/r/vim/comments/m736j3/-/gr9l8x8

When referring to commands with brackets like [I in the above example, the markdown formatting breaks. It's not critical because the link stays visible anyways, but easily circumvented by putting a \ before the [s and ]s in the command.

Abraxas-Knister avatar Mar 17 '21 19:03 Abraxas-Knister

The isssue I mean looks like this bracket
and happens on some reddit platforms.

It does not happen on new reddit in the browser (for me at least) so it's probably expected that the other platforms (except for old reddit, of course) would want to work towards that. I noticed the issue on boost on android.

You could change the formatting for queries that contain [] from monospaced to escaped brackets, but that too isn't guarandeed to work everywhere.

Abraxas-Knister avatar Mar 17 '21 20:03 Abraxas-Knister

Apparently escaping with '' does not work with backticks. This is a tricky one.

heraldofsolace avatar Apr 02 '21 07:04 heraldofsolace

I encountered a similar ]-related issue that renders incorrectly on old and new reddit:

Responding to:
:h `]

Yields:
* [``]`](https://vimhelp.org/motion.txt.html#%60%5D) in _motion.txt_

More correct markdown would be:

* [\`\]](https://vimhelp.org/motion.txt.html#%60%5D) in _motion.txt_

However, that's missing the fixed width styling. But I'm not sure that styling is worth keeping in these tricky corner cases?

Looking at OP's issues, neither of these render correctly on old reddit:

* [`\[I`](https://vimhelp.org/tagsrch.txt.html#%5BI) in _tagsrch.txt_
* [`[I`](https://vimhelp.org/tagsrch.txt.html#%5BI) in _tagsrch.txt_

But this does:

* [\[I](https://vimhelp.org/tagsrch.txt.html#%5BI) in _tagsrch.txt_

Seems like help terms containing [] or ` should give up the fixed width and use escaping. Especially since markdown parsers are often inconsistent (don't old and new reddit's have different quirks?). Using simpler markdown is more likely to display properly for more users.

idbrii avatar Oct 08 '22 07:10 idbrii

This is fixed now

heraldofsolace avatar Jun 01 '24 02:06 heraldofsolace