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

fix(post): escape swig full tag with args #4824

Merged
merged 1 commit into from
Nov 23, 2021
Merged

fix(post): escape swig full tag with args #4824

merged 1 commit into from
Nov 23, 2021

Conversation

stevenjoezhang
Copy link
Member

@stevenjoezhang stevenjoezhang commented Nov 23, 2021

What does it do?

  1. For the following content
{% mermaid graph TD %}
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
{% endmermaid %}

The current state machine implementation will parse {% mermaid graph TD %} and {% endmermaid %} as two separate in-line swig tags (#4780)

  1. And according to the static analysis from lgtm, swig_tag_name_begin on line 123 of lib/hexo/post.js is always true
    https://lgtm.com/projects/g/hexojs/hexo?mode=list

Both issues are resolved in this pull request.

How to test

git clone -b swig https://github.com/hexojs/hexo.git
cd hexo
npm install
npm test

Screenshots

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.001%) to 98.121% when pulling bc32c6c on swig into 902cd70 on master.

@SukkaW SukkaW merged commit 3ed6fd9 into master Nov 23, 2021
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.

None yet

3 participants