You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to always create an error node if there is a blank line missing before a section? If not, what kind of query would I need to use to detect something like this?
The text was updated successfully, but these errors were encountered:
keewis
changed the title
detecting missing blank lines between sections
detecting missing blank lines before sections
Oct 21, 2023
keewis
changed the title
detecting missing blank lines before sections
detecting missing blank lines before section headers
Oct 21, 2023
I may look into what docutils does for cases like this.
docutils appears to do something similar: warn / error (not sure how to interpret the output) if there's no blank line between definition list and section, but if there's a paragraph in front of the section concatenate it to that paragraph.
I guess the question now is: is there ever a case where you'd want to have something within a paragraph that resembles a section? If not, I'd argue that it is better to deviate from what docutils is doing and raise an error.
At the moment, this:
paragraph Section ------- section content
is parsed to
(document (paragraph) (section (title)) (paragraph))
.However, mistakenly omitting the blank line:
paragraph Section ------- section content
is parsed to
(document (paragraph))
, where the paragraph contains a node for each word and every single adornment character.If we were to change the first line to a definition list:
term : classifier definition Section ------- section content
the parsed result would contain a error node:
For comparison, with the blank line, the document parses as
Would it be possible to always create an error node if there is a blank line missing before a section? If not, what kind of query would I need to use to detect something like this?
The text was updated successfully, but these errors were encountered: