yzhang-gh / vscode-markdown

Markdown All in One
https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
MIT License
2.91k stars 322 forks source link

TOC: Option to not escape underscores in SCREAMING_SNAKE_CASE #1466

Open RandyTidd opened 5 days ago

RandyTidd commented 5 days ago

Proposal

The table of contents generator adds escape characters to underscores in the middle of SCREAMING_SNAKE_CASE identifiers. I see that underscores may be backslash escaped, but do they have to be in this case where there is no preceding or following whitespace? Admittedly, my read of CommonMark is naive.

If they are unnecessary, I'd love to have them excluded by default or with an option to improve readability of the markdown source.

Markdown source w/ generated TOC:

# SCREAMING_SNAKE_CASE_EXAMPLE

- [SCREAMING\_SNAKE\_CASE\_EXAMPLE](#screaming_snake_case_example)
  - [H2\_NAME\_ONE](#h2_name_one)
    - [H3\_NAME\_ONE](#h3_name_one)

## H2_NAME_ONE

### H3_NAME_ONE

VS Code Preview: image

Other information