Conversation
A line that starts with a valid attribute list but continues with
other text ("{.class} trailing text") was consumed as an attributes
block and the trailing text was silently dropped from the output.
Such a line is regular paragraph text: require the rest of the line
to be blank, otherwise restore the reader position and fall through
to the paragraph parser.
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.
Fixes #3.
A line that starts with a valid attribute list but continues with other text (
{.class} trailing text) was consumed as an attributes block and the trailing text was silently dropped from the output.This change requires the attribute list to be the only content on its line: after
parser.ParseAttributessucceeds,Opennow checks that the rest of the line is blank. Otherwise it restores the saved reader position (the same patternParseAttributesitself uses on failure) and returnsparser.RequireParagraph, so the line stays regular paragraph text.The new test covers the three cases: a pure attribute line still attaches, a trailing-text line stays literal text inside the paragraph, and a standalone
{ .foo } some textline no longer vanishes. The existing tests pass unchanged.