jrblevin / markdown-mode

Emacs Markdown Mode
http://jblevins.org/projects/markdown-mode/
GNU General Public License v3.0
875 stars 160 forks source link

Markdown hiding for links broken when text surrounded by square brackets #819

Open meliache opened 7 months ago

meliache commented 7 months ago

I added the link

[`[resources]`](https://luigi.readthedocs.io/en/stable/configuration.html?highlight=resources#resources) section you can

which on github renders properly as [resources]. In markdown-mode the markdown-hiding is broken for that type of link text. I admit this is tricky, not sure how other mardown-renderers handle this. But gfm-mode at least should aim to reproduce what github is showing.

Expected Behavior

When markdown hiding is enabled, render a link to a toml section where the link text contains the square brackets as [text], don't show the URL.

Actual Behavior

All parts of the markdown are shown, nothing is hidden when the link text is surrounded by square brackets in Emacs: image

Steps to Reproduce

Reproduced with

emacs -Q --load path/to/markdown-mode.el test-case.md

M-x gfm-mode M-x markdown-toggle-markup-hiding test-case.md

Software Versions