mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 01:36:03 +03:00
[GH-ISSUE #366] MD041: errors when using html's h1 instead of # in most cases #309
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#309
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 @nnmrts on GitHub (Jan 12, 2021).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/366
With the rule MD041 (first-line-heading) enabled:
#simple
code:
rendered:
image as title
code:
rendered:
centered image as title using
pandimgcode:
rendered (note: this renders differently in github readmes than comments; the heading line below the image here is above the image in readmes (which is not what we want in general)):
centered image as title using
h1andimg(this has two level-1 headings in one line and also (correctly) renders two heading lines, both is not nice)code:
rendered:
h1stuff as long as something with#comes after itcode: rendered:
simple
code:
rendered:
image as title
code:
rendered:
While I know that using
h1instead of#is not "pure" and that using images as titles is kinda weird, both are often seen in GitHub readme files for a reason. The first one because you can't center#, but you can centerh1(<h1 align="center">title</h1>). The second one because the first image (or even the first "thing") in a readme often is the logo, which includes the project name most of the time, so it feels kinda redundant to have the name of your project above the logo of your project which includes the name of your project again.@nnmrts commented on GitHub (Jan 12, 2021):
I'm writing a new comment here so I don't have to edit the original issue again (sorry):
Is there a rationale behind the rule just accepting
#and noth1as well? I would suggest either:@DavidAnson commented on GitHub (Jan 12, 2021):
I kind of feel like this is an abuse of Markdown, but it may be straightforward to add and I'll have a look.
@nnmrts commented on GitHub (Jan 12, 2021):
@DavidAnson I agree. As I said, this is not pure, and it is far from beautiful too. If there was a way to center images (or anything at all) in markdown on GitHub, I (and many others) would definitely use it before even considering using html tags. There is so much potential for styling markdown on GitHub, but after years of proposals and ideas to support a limited version of the
styleattribute or some sort of inlineclassattributes on their end, it seems like they just don't want to go in that direction with markup, I guess.Normally this wouldn't be in the scope of markdownlint at all, and I'd fully understand if this rule never gets changed. But in my mind and since using html to do stuff markdown can't do is a common practice, this would be a great change.
@MichaIng commented on GitHub (Feb 10, 2021):
Ah nice, many thanks, we suffer from this issue just now. I hope for a soon release of markdownlint-cli2 to contain this change?
@DavidAnson commented on GitHub (Feb 10, 2021):
Yes
**Table of Contents**by default or make it configurable #2115