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): avoid swig in code being double escaped #4362

Merged
merged 1 commit into from
Jun 20, 2020

Conversation

SukkaW
Copy link
Member

@SukkaW SukkaW commented Jun 18, 2020

What does it do?

Continuing #4352

https://github.com/hexojs/hexo/pull/4352/files#r441953318

Marked.js will escape code by default. If the swig inside `` has been escaped, it will be escaped again by marked.js.

This PR avoid it.

cc @stevenjoezhang

How to test

git clone -b avoid-swig-double-escape https://github.com/sukkaw/hexo.git
cd hexo
npm install
npm test

Screenshots

Pull request tasks

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

@SukkaW SukkaW requested review from stevenjoezhang and a team June 18, 2020 09:16
stevenjoezhang
stevenjoezhang previously approved these changes Jun 18, 2020
Copy link
Member

@stevenjoezhang stevenjoezhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@SukkaW
Copy link
Member Author

SukkaW commented Jun 19, 2020

It seems that the PR has huge impact on performance. I don't know if there is a better way to do that.

@SukkaW
Copy link
Member Author

SukkaW commented Jun 19, 2020

@stevenjoezhang

Refactored & rebased, with performance improvements.

curbengh
curbengh previously approved these changes Jun 20, 2020
@SukkaW
Copy link
Member Author

SukkaW commented Jun 20, 2020

Would you mind reviewing this again? I have rebased to solve conflict.

@coveralls
Copy link

coveralls commented Jun 20, 2020

Coverage Status

Coverage remained the same at 97.816% when pulling 531e9fa on SukkaW:avoid-swig-double-escape into 05bc34b on hexojs:master.

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.

4 participants