Do not warn about missing text on headings that have a header - #810
Open
Sanjays2402 wants to merge 1 commit into
Open
Do not warn about missing text on headings that have a header#810Sanjays2402 wants to merge 1 commit into
Sanjays2402 wants to merge 1 commit into
Conversation
Heading items (level ending in .0, non-normative) are commonly described by their header attribute alone, with text left empty. The item validator checked only item.text, so every such heading emitted a "no text" warning during validation, making the warning useless noise on documents that use headings for structure. Headings are now accepted when either text or header is present, and warn with "no text nor header" only when both are empty. Non-heading items are unchanged. The REQ007 fixture is exactly this shape (heading, header set, empty text), so the two document/tree issue-count expectations drop by one.
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.
Closes #706
Heading items (level ending in
.0, non-normative) are often described byheaderalone withtextleft empty, but the validator checked onlytext, so every such heading emitted ano textwarning. Headings are now accepted when eithertextorheaderis set, and warnno text nor headeronly when both are empty; non-heading items are unchanged. This is the shape @opt12 proposed on the issue.The
REQ007fixture is exactly this case, so the two issue-count expectations intest_all.pydrop by one.