Repository navigation
fix(lint): read numbered level-two headings as register entries - #82
Merged
Merged
Conversation
A register written as `## N. Title` headings read as holding no entry, so converting it to a numbered list was not checked entry for entry, and a numbered list at the left margin inside one of its entries read as entries of its own and blocked the conversion. A level-two heading at the top level of the body whose text opens with a number, a full stop and white space is now an entry, as the supersession-marks proposal states. Where a version holds a heading entry, no numbered list item in it is an entry. The proposal's fixtures are updated to its current commit.
A list item closes before its entry ends when an unindented paragraph follows a blank line, yet the parser kept reading later lines indented by one to three spaces as inside the item, so a heading, thematic break, numbered item or fence there was swallowed into the entry. The reader now tracks the item's open state apart from the entry's, and whether the open paragraph sits at the top level, so that only a non-empty item numbered 1 may interrupt such a paragraph while any item may open where a line falls out of a list or block quote.
Lines inside a list nested in an entry were judged against the entry's own item, so indented code there read as a paragraph and took lazy lines, and an unindented line after it kept the item open. A numbered line that followed could then open an entry CommonMark does not have. Track the content columns of nested list items and judge laziness, indented code, block starts and fence openers against the innermost one. A fence opens on a list item's first line and closes with the item it sits in; an opener indented four or more columns past its container, a thematic break of bullet characters and an empty `*` or `+` continuing a top-level paragraph open nothing.
The supersession-marks proposal now gives each rule its own clause, and adds a fixture for the warning on a format change of an artefact with no entry. Copy its fixtures and pin them, cite the new clause numbers, and require each warning rule to fire on a fixture under its clause.
The proposal says a supersession mark or legacy note does not count inside a code block, and aw hid them only in code spans and fenced blocks. Lines in an indented code block inside an entry now hide them too, keeping their words. Reading which lines are indented code also corrects three paragraph-state errors: a lazy setext underline no longer closes the paragraph, an empty item line leaves no open paragraph, and an empty bullet closes at the next blank line.
Describe word-change groups and clause 3.10's kept names as the proposal now words them, without the supersedes and superseded-by sets it no longer defines.
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.
Read a binding artefact's
## N. Titleheadings as its entries. A register kept in that form read as holding no entry, so its conversion to a numbered list went unchecked, and a numbered list at the left margin inside an entry read as entries of its own and blocked the conversion.A level-two heading at the top level of the body whose text opens with a number, a full stop and white space is now an entry, running to the next top-level heading of level one or two, a thematic break or the end of the body. Where a version holds a heading entry, no numbered list item in it is an entry, so a list-form register that also holds a top-level numbered
##section heading now reads in heading form and fails loudly on commit.List entries also follow CommonMark once their item has closed. A heading, thematic break or numbered item indented up to three spaces after it ends the entry, and a numbered line that continues a top-level paragraph is no longer an entry, so a register written that way fails loudly on its next commit. Lists nested in an entry, indented code and fences are read as CommonMark reads them too, so an unindented line after indented code in an item no longer keeps the item open. A supersession mark or legacy note inside an indented code block no longer counts, as one inside a fenced block already did not.
The supersession-marks fixtures move to the proposal's commit that defines heading entries and gives each rule its own clause, and the suite cites the new clause numbers. That commit is still under review in aw-tools/agentic-workspace#28, and the pin moves to its merged commit before this lands.