Repository navigation
Conversation
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.
A link destination may contain parentheses only if they are escaped or part of a balanced pair.
LinkScanner.scanLinkDestinationWithBalancedParenschecks the balance when it sees), but returns success at a space, a control character (including the line ending) or the end of the input without checking that all opened parentheses were closed. For inline links the following)check catches this. For link reference definitions it does not, so invalid definitions are accepted and their text disappears:[foo]: (<p>[foo]: (</p>[foo]: (\nbar<p>[foo]: (\nbar</p><p>bar</p>[foo]: a(b\n\n[foo]<p>[foo]: a(b</p>\n<p>[foo]</p><p><a href="a(b">foo</a></p>The three exits now also require
parens == 0. Valid destinations such asa(b)and inline links are unaffected.Added
SpecialInputTest.linkReferenceDefinitionWithUnbalancedParens; it fails before the change and passes after.mvn testpasses, except thatPathologicalTest.paragraphOfLinesThatTryBlockStartshit its 3 s timeout once on a heavily loaded machine. That test is unrelated and passes when run on its own, on main as well as on this branch.spotless:checkis clean.Found by differential testing against cmark.