mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 17:26:22 +03:00
[GH-ISSUE #62] MD026 should not fire for semi-colons in a html entity #1898
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#1898
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jeroenheijmans on GitHub (Jun 13, 2017).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/62
Please consider this snippet of markdown:
The VSCode extension "markdownlint" version 0.9.1 will present a MD026 warning like this:
So it shows:
and highlights the semi-colon.
If possible the rule should not trigger on html entities. If this isn't feasable it would be nice to have a footnote in linked docs explaining a workaround (if any).
@DavidAnson commented on GitHub (Jun 13, 2017):
The documentation does mention that the
punctuationparameter can be used to change the list of characters: https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md026I'll think about special treatment for HTML entities. Thanks!
@DavidAnson commented on GitHub (Jun 14, 2017):
Thinking about this more, there may be a better way. I think you're probably trying to do this:
But that triggers
MD020/no-missing-space-closed-atxbecause of the hash at the end. So you escaped with an HTML entity.Instead, what if you escaped via the Markdown convention of '\'? That would look like this:
And triggers no warnings from
markdownlintand has the benefit of being native Markdown (i.e., no assumption about rendering to HTML).I think this is a better solution and will close the issue if you agree.
Read more here if interested: https://daringfireball.net/projects/markdown/syntax#backslash
@jeroenheijmans commented on GitHub (Jun 14, 2017):
Your analysis is spot on. I was indeed trying to escape the
#but failed to realize I could've done so with a\instead of a html entity.Thanks for your time, insights, and in general a great plugin 👍