Fix underscores within bold text getting emphasized (#589) #590
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.
This PR fixes #589, which saw a regression for the following snippet:
This regression was introduced in fcaadfe when the
code-friendly
extra was converted to the newExtra
format.Prior to this change we had two different versions of the strong/em regexes and we'd run one or the other. That's not possible in the new format so the
CodeFriendly
extra runs before italics and bold and hashes text to protect it from the regex.Currently it only hashes text if it's using the
_underscore bold syntax_
, but for*star syntax*
it doesn't check if the text contains any underscores, which is how this can slip through.I've modified the extra to check for underscores within the bold text. It will now hash that text, protecting it from the strong/em regex, and it will be unhashed afterwards.