Closed nojronatron closed 1 year ago
Confirmed the 'ampersand' character is a culprit.
The dash -
character causes a transformation problem.
A heading like ## Monday 26-June-2023
results in a TOC entry like - [Monday 26](#monday-26)
with an under-squiggle and MD051 (link fragment) message.
Intended result is: - [Monday 26-June-2023](#monday-26-june-2023)
See PR #12 for progress on fixing this issue.
Closing with merge-in of PR #12
Observed
A valid markdown document contains an L2 heading with a colon
:
character in the heading text. Create Markdown TOC creates the a Link Fragment in the table of contents.## Primer: How Linux Works
returns- [Primer](#primer)
which triggers MD051 Rule.Expected
Create Markdown TOC ignores characters like colon, semicolon, etc, and creates only full bookmark links for all L2 headings.
Actual
Create Markdown TOC ignores remaining characters at and beyond the colon
:
character and a partial link is created instead.Severity
Low. It is easy for the user to edit their markdown document to avoid the situation prior to running Create Markdown TOC.
Comments
Will need to create tests for Markdown Rules for Headers to determine minimum required character types/classes for the Link to avoid creating a fragment. Initial testing indicates ignoring any non-alphanumeric characters is good enough to create a valid Link.
Example
## Test ,.;':[]{}!@$%^&*() Header
ideally would return something like- [Test Header](#test-header)
.