Skip to content

Conversation

@ang-zeyu
Copy link
Contributor

@ang-zeyu ang-zeyu commented Dec 6, 2020

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • Others, please explain:

Follow up to #1101
Surfaced in #1403

Overview of changes:

  • Add negative lookahead to starting pattern for special tag patch for markdown-it

Anything you'd like to highlight / discuss:
This was not apparent before as the only special tag in our tests is <puml>.
These are processed before markdown-it ever touches them, resulting in false positives.

Testing instructions:

Tested on https://regexr.com/, then #1403

Proposed commit message: (wrap lines at 72 characters)
Ignore self-closing special tags for markdown-it

The markdown-it patch for special tags does not blacklist self-closed
special tags from the starting regex pattern. Thus, the starting regex
pattern incorrectly matches such a self-closing special tag, and the
ending regex pattern incorrectly seeks for a corresponding closing
special tag until EOF.

This is not apparent in the functional tests which have such tags
(<puml>), because puml tags are processed before markdown.

Let's add a negative lookahead to the starting pattern to blacklist
such tags.


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features (architectural restructure in V3 baseline #1403 surfaces this with our existing tests)
  • Linked all related issues
  • No blatantly unrelated changes
  • Pinged someone for a review!

The markdown-it patch for special tags does not blacklist self-closed
special tags from the starting regex pattern. Thus, the starting regex
pattern incorrectly matches such a self-closing special tag, and the
ending regex pattern incorrectly seeks for a corresponding closing
special tag until EOF.

This is not apparent in the functional tests which have such tags
(<puml>), because puml tags are processed before markdown.

Let's add a negative lookahead to the starting pattern to blacklist
such tags.
@ang-zeyu ang-zeyu added this to the v3.0 milestone Dec 6, 2020
@ang-zeyu ang-zeyu merged commit 089cb7c into MarkBind:master Dec 6, 2020
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