mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 17:26:22 +03:00
[GH-ISSUE #367] MD020: Breaking &nbps; not detected inbetween heading hashtags and heading title #2156
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#2156
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 @muttoni on GitHub (Jan 19, 2021).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/367
Hi, I had a devilishly difficult to track markdown issue caused by a weird space character inbetween the heading hashtags and the heading title. This was all due to the decimal charcode being 160 (non breaking space
) instead of 32 (a regular space).## Subheading that doesn't work
Subheading that works
Could you please detect this as an issue? As you can see, it breaks the Github markdown parser as well and it's very hard to track down unless you know the issue. I was blaming the surrounding contents for breaking the parser as Markdown Lint does not flag this as an issue (see below).
Edit: I initially thought this could be a rare edge case, but I've now realized what caused the nbps...typing with an IT layout means that in order to type a hashtag I need to press the Alt Gr modifier key (+ à). The modifier key also causes spacebar to generate a non-breaking space. When typing quickly it's easy to press spacebar while Alt Gr is still pressed.
@muttoni commented on GitHub (Jan 19, 2021):
Upon browsing the source code, this is likely falls in the MD020 category. It also might be a good time to extend the test across all types of non-admissable whitespace characters:
@DavidAnson commented on GitHub (Jan 19, 2021):
This looks to be because the CommonMark definition of "whitespace" is more restrictive than JavaScript's RegExp: