VimHelpBot icon indicating copy to clipboard operation
VimHelpBot copied to clipboard

Target link for `:help [` produces broken markdown link

Open Gumnos opened this issue 2 years ago • 1 comments

Describe the bug

Issuing :help [ produced a rendering issue with the bot's resulting markdown

To Reproduce

Steps to reproduce the behavior:

  1. Create a comment in /r/vim containing :help [

  2. Let the bot respond

Expected behavior

Expected a link to the corresponding help-target https://vimhelp.org/index.txt.html#%5B (which it found & created), but the Markdown of the link got messed up. See https://www.reddit.com/r/vim/comments/15lvgi2/what_commonly_used_vim_motionsthemesfeatures_do/jvd80or/

  • [] Willing to take up?

Gumnos avatar Aug 08 '23 23:08 Gumnos

This is weird, because the bot definitely produces URL-encoded text. We already have tests for that. Maybe Reddit is changing the URL when posting. I will look into it

heraldofsolace avatar Dec 02 '23 06:12 heraldofsolace

I'm getting a similar issue with ] in links as shown in this helpbot reply where the help-link for ]p seems to trigger breakage in the generated Markdown (it finds the correct help-target URL and uses that, just putting the "wrong" thing in the […]() bit of the link causing it to get misinterpreted). Both of these are in Old Reddit, FWIW.

Screenshot of rendered output hiccup

Gumnos avatar May 26 '24 20:05 Gumnos

This seems to be the case for old Reddit only. In new Reddit it renders correctly. I think I can circumvent this problem by replacing the brackets with full width square brackets.

heraldofsolace avatar May 27 '24 04:05 heraldofsolace

This is fixed now

heraldofsolace avatar Jun 01 '24 02:06 heraldofsolace