Ignore first element if it is a comment when determining page title#3956
Ignore first element if it is a comment when determining page title#3956mschoettle wants to merge 2 commits intomkdocs:masterfrom
Conversation
|
I can assure you that this Allowing a comment, if there's some problem with it, should probably be a much more targeted change. |
It was not my intention to suggest that #3191 broke previous behaviour. Sorry if that came across. I was trying to figure out where the title is determined and found the most recent change, so I did not look at original behaviour at all. I updated the description. The way I understood "report the first H1 tag" in the PR description was that it would look until it found it. I agree that the heading should come first. I'll try to figure something out that still expects the heading to come first but allows for comments. |
|
I reverted my change and added a more targeted change to skip the first element if it is an HTML placeholder. |
|
Nice :) |
When a Markdown document starts with a comment (for example, a copyright notice, such as one gets when adopting REUSE, the heading is not found.
Comments are converted to HTML placeholders by
markdown.Change the logic to ignore the first element if it is a placeholder (in case it comes before the first-level heading).