mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 17:26:22 +03:00
[GH-ISSUE #198] MD018 triggered inside HTML pre/code block #2018
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#2018
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 @nschonni on GitHub (Jun 14, 2019).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/198
Looks like
#inside pre/code blocks still get picked up as Markdown headersEX:
From
github.com/MicrosoftDocs/azure-docs@ceeac2e6be/articles/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker.md@DavidAnson commented on GitHub (Jun 14, 2019):
That’s not a Markdown code block - it’s an HTML code block. Is that deliberate? If so, why? I don’t think there’s precedent for markdownlint to recognize HTML structures.
@nschonni commented on GitHub (Jun 14, 2019):
Not sure why they decided to use a manual pre/code block here, but I would have thought it would treat it similarly to a code fence. I know this style can be required inside tables, since code fences don't always work properly there.
@DavidAnson commented on GitHub (Jun 14, 2019):
My current thinking is that this is not proper Markdown and represents an anti-pattern. I’m not looking to maintain an HTML parser/linter in addition to this one - which would seem necessary to catch cases like this or to find spaces inside a bold or italics or link tag (all of which are rules today which someone might reasonably be expected to extend to HTML). Unless someone points to widespread use of this pattern that seems justified, my thinking is to close this issue as being outside the scope of the project.
I hope that reasoning makes sense!
@nschonni commented on GitHub (Jun 14, 2019):
Yup, it's a weird edge case. Looking at some of the other blocks, it looks like they're using this style to use
<b>tags to add emphasis to text inside the blocks. I don't think that works inside the regular code fences.I could see treating these as code fences, but I can see that would have problems with other rules (EX: adding language to the code fence)
@DavidAnson commented on GitHub (Jun 14, 2019):
Yep, there is already a rule saying not to include HTML elements in your Markdown; supporting this would be in defiance of that!
@nschonni commented on GitHub (Jun 14, 2019):
I'll see if I can give some other examples besides the
<b>thing here. Markdown tables commonly need HTML for things like code fences, lists, line breaks anyway, so that might be a better test case. That wouldn't apply to the MD018 rule though@DavidAnson commented on GitHub (Jul 27, 2019):
Closing for now.