Repository navigation
fix: let a hard line break keep a nested list separate - #1226
Open
any-victor wants to merge 1 commit into
Open
any-victor wants to merge 1 commit into
any-victor wants to merge 1 commit into
Conversation
A hard line break renders as <br>, which has no end tag. Nothing removed it from the tag history, so Vale read it as an open inline element. A nested list after it joined the list item above, and an enclosing </em> could not pop its own tag. A void tag now leaves the history as soon as it enters. Closes vale-cli#1225. Assisted-by: Claude Code
|
Before this is reviewed, please read the AI-Assisted Contributions section of the contributing guide and make sure this change meets it: you can explain every line, the description is your own and brief, it fixes a bug you hit or a feature agreed in an issue, it does not touch undocumented options, and any substantial tool use is noted. |
|
The license agreement is signed. |
Author
|
I have read the CLA and I agree to it |
This branch has not been deployed
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 #1225.
Motivation
A hard line-break renders as
<br>, which has no end tag. While Vale walks the HTML, it keeps a history of open tags, and nothing removed<br>from it. Vale then read the list item as still inside an inline element:listrule saw one long item.<br>also blocked</em>, which removes its tag only when that tag is last in the history.Change
A void tag now leaves the history as soon as it is added, in
internal/lint/ast.go.Verification
scopescase,list-item-with-hard-break, checks a plain hard break and one inside*…*. Each item is counted on its own: 4, 7, 7 and 7 words. For the plain case, this matches 3.24.0, positions included.go test ./...passes on Linux with the grammars built.commit-msghook.Assisted-by: Claude Code