Skip to content

Do not warn about missing text on headings that have a header - #810

Open
Sanjays2402 wants to merge 1 commit into
doorstop-dev:developfrom
Sanjays2402:fix/heading-validation-header-706
Open

Do not warn about missing text on headings that have a header#810
Sanjays2402 wants to merge 1 commit into
doorstop-dev:developfrom
Sanjays2402:fix/heading-validation-header-706

Conversation

@Sanjays2402

Copy link
Copy Markdown
Contributor

Closes #706

Heading items (level ending in .0, non-normative) are often described by header alone with text left empty, but the validator checked only text, so every such heading emitted a no text warning. Headings are now accepted when either text or header is set, and warn no text nor header only when both are empty; non-heading items are unchanged. This is the shape @opt12 proposed on the issue.

The REQ007 fixture is exactly this case, so the two issue-count expectations in test_all.py drop by one.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warnings when validating documents with headings

1 participant