[GH-ISSUE #62] MD026 should not fire for semi-colons in a html entity #1898

Closed
opened 2026-03-07 20:02:33 +03:00 by kerem · 3 comments
Owner

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:

# Java vs C#

The VSCode extension "markdownlint" version 0.9.1 will present a MD026 warning like this:

image

So it shows:

Click for more information about MD026

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).

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: ```md # Java vs C# ``` The VSCode extension "markdownlint" version 0.9.1 will present a **MD026** warning like this: ![image](https://user-images.githubusercontent.com/1590536/27070383-13e9fe02-5019-11e7-9546-ab57d8317e7b.png) So it shows: > Click for more information about MD026 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](https://github.com/DavidAnson/markdownlint/blob/v0.5.0/doc/Rules.md#md026) explaining a workaround (if any).
kerem 2026-03-07 20:02:33 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Jun 13, 2017):

The documentation does mention that the punctuation parameter can be used to change the list of characters: https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md026

I'll think about special treatment for HTML entities. Thanks!

<!-- gh-comment-id:308138386 --> @DavidAnson commented on GitHub (Jun 13, 2017): The documentation does mention that the `punctuation` parameter can be used to change the list of characters: https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md026 I'll think about special treatment for HTML entities. Thanks!
Author
Owner

@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:

# Java vs C#

But that triggers MD020/no-missing-space-closed-atx because 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:

# Java vs C\#

And triggers no warnings from markdownlint and 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

<!-- gh-comment-id:308331394 --> @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: ```md # Java vs C# ``` But that triggers `MD020/no-missing-space-closed-atx` because 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: ```md # Java vs C\# ``` And triggers no warnings from `markdownlint` and 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
Author
Owner

@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 👍

<!-- gh-comment-id:308406429 --> @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 👍
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#1898
No description provided.