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

[BUG] Inline code not escaping blocks of back ticks. #6

Closed
SSlinky opened this issue Oct 12, 2021 · 2 comments
Closed

[BUG] Inline code not escaping blocks of back ticks. #6

SSlinky opened this issue Oct 12, 2021 · 2 comments
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@SSlinky
Copy link
Owner

SSlinky commented Oct 12, 2021

Two or more back ticks should not be interpreted as inline code markers / fences. They should be parsed literally as either normal text or inline code, depending on where the single back ticks are.

To Reproduce
Steps to reproduce the behavior:

  1. Create a markdown file that includes a block of two or more back ticks inside inline code.
    e.g. Some inline code with ```` ticks present.
  2. Run the parser.

Expected behavior
Three inline text blocks created with styles normal, inline code, normal, respectively.
Text content is "Some ", "inline code with ```` ticks", and " present." respectively.

Additional context
The root cause is the RegEx pattern that finds inline code.

@SSlinky SSlinky added the bug Something isn't working label Oct 12, 2021
@SSlinky
Copy link
Owner Author

SSlinky commented Oct 12, 2021

Current pattern is:

([^\\`](?:\\\\)*)(`)((?:[^`\n]+?))(`)

@SSlinky
Copy link
Owner Author

SSlinky commented Oct 14, 2021

Back ticks should not be escaped. This is a feature. Code fences here should match exactly, i.e. the close fence must be the same number of back ticks as the open.

@SSlinky SSlinky closed this as completed Oct 14, 2021
@SSlinky SSlinky added the invalid This doesn't seem right label Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant