-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
context
running the following doc through mdformat with mdformat-toc enabled:
# Overview
<!-- mdformat-toc start --slug=github --no-anchors --maxlevel=6 --minlevel=1 -->
## A heading with\:a colon
Some more textProduces this output:
# Overview
<!-- mdformat-toc start --slug=github --no-anchors --maxlevel=6 --minlevel=1 -->
- [Overview](#overview)
- [A heading with:a colon](#a-heading-witha-colon)
<!-- mdformat-toc end -->
## A heading with:a colon
Some more textexpectation
I expected the escape (\:) to be preserved in the header on format.
bug
But instead the escape is removed.
When linting the output doc with markdownlint-cli2, I get the following error:
❯ markdownlint-cli2 test.md
markdownlint-cli2 v0.18.1 (markdownlint v0.38.0)
Finding: test.md
Linting: 1 file(s)
Summary: 1 error(s)
test.md:4:5 MD051/link-fragments Link fragments should be valid [Context: "[A heading with:a colon](#a-heading-witha-colon)"]
Restoring the escape in the header fixes the linting error:
# Overview
<!-- mdformat-toc start --slug=github --no-anchors --maxlevel=6 --minlevel=1 -->
- [Overview](#overview)
- [A heading with:a colon](#a-heading-witha-colon)
<!-- mdformat-toc end -->
## A heading with\:a colon
Some more text❯ markdownlint-cli2 test.md
markdownlint-cli2 v0.18.1 (markdownlint v0.38.0)
Finding: test.md
Linting: 1 file(s)
Summary: 0 error(s)
See DavidAnson/markdownlint#1771 for more details.
Reproduce the bug
See above
List your environment
❯ mdformat --version
mdformat 0.7.22 (mdformat_frontmatter 2.0.8, mdformat-gfm 0.4.1, mdformat_gfm_alerts 2.0.0, mdformat_tables 1.0.0, mdformat_mkdocs 4.4.1, mdformat-toc 0.3.0, mdformat_footnote 0.1.1)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working