Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve markdownRule syntax matching #165

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

psvenk
Copy link

@psvenk psvenk commented Jun 4, 2020

  • markdownRule now only matches if a line contains 0-3 spaces followed by the characters forming the rule (e.g. ␣␣*␣*␣*␣*␣*), with nothing else on the line. This is in accordance with CommonMark (and compatible with the original spec, which does not allow whitespace before the characters forming the rule).
  • A horizontal rule can also be formed by underscores, in accordance with the original spec and CommonMark.
  • An italic, bold, or bold-italic region is no longer started if the delimiter is adjacent to a copy of itself (possibly with whitespace in between). For example, an italic or bold region delimited by asterisks would not begin if the beginning asterisk(s) is/are adjacent to another asterisk. This should not have any practical consequences (italic/bold regions consisting only of whitespace would not be matched), other than that horizontal rules made of asterisks or underscores will now be matched and highlighted properly.
Screenshot

Screenshot at 2020-06-04 11-46-06

- Change existing markdownRule syntax matching rules to match only if
  preceded by 0-3 spaces and nothing else (in accordance with
  CommonMark)
- Add support for horizontal rules (thematic breaks) using underscores
  (in accordance with John Gruber's original spec and CommonMark)
- Change the italic and bold syntax matching so that they do not collide
  with horizontal rules composed of asterisks or underscores
@psvenk
Copy link
Author

psvenk commented Jul 7, 2020

I apologize for the repeated notifications; I accidentally pushed another commit to this branch just now. This should now be fixed (I force-pushed HEAD^).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant