Repository navigation
fix: strip the heading the cover page actually promotes - #22
Merged
Merged
Conversation
`extract_title` now reads the parsed document, so it correctly ignores a `# ` line inside fenced code and recognizes an underlined H1. `strip_first_heading` was still scanning raw lines, and the two could disagree. A file opening with a shell block lost the `# install` comment out of its code and then printed its real title twice, once on the cover and once as a heading. A file whose title is underlined rather than prefixed kept the heading for the same reason. Both come from deciding what a heading is by looking at a single line, so the scan now tracks fences and treats an `=` underline as the H1 it is.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
extract_titlenow reads the parsed document, so it correctly ignores a#line inside fenced code and recognizes an underlined H1.strip_first_headingwas still scanning raw lines, and the two could disagree.A file opening with a shell block lost the
# installcomment out of its code and then printed its real title twice, once on the cover and once as a heading. A file whose title is underlined rather than prefixed kept the heading for the same reason. Both come from deciding what a heading is by looking at a single line, so the scan now tracks fences and treats an=underline as the H1 it is.