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(escapeAllSwigTags): backtrack when tag is incomplete #5618

Merged
merged 3 commits into from
Feb 12, 2025

Conversation

D-Sketon
Copy link
Member

@D-Sketon D-Sketon commented Jan 18, 2025

What does it do?

fix #5571
fix #5301
fix hexojs/hexo-renderer-pandoc#60

Screenshots

Pull request tasks

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

Sorry, something went wrong.

Copy link

How to test

git clone -b fix/render https://github.com/D-Sketon/hexo.git
cd hexo
npm install
npm test

@coveralls
Copy link

coveralls commented Jan 18, 2025

Pull Request Test Coverage Report for Build 13286910631

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 144 of 145 (99.31%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 99.462%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/hexo/post.ts 144 145 99.31%
Totals Coverage Status
Change from base Build 13176180491: 0.01%
Covered Lines: 9791
Relevant Lines: 9844

💛 - Coveralls

@D-Sketon D-Sketon marked this pull request as draft January 19, 2025 07:20
@D-Sketon D-Sketon marked this pull request as ready for review January 19, 2025 07:32
@uiolee

This comment was marked as off-topic.

@D-Sketon
Copy link
Member Author

In fact, this is a tricky problem—when the incomplete first part of the tag and the incomplete second part of the tag are concatenated, they form a complete tag, which is then parsed as Swig.

For the following text 123 {#} 123 {#} 123, I think Hexo could parse it as either 123 {#} 123 {#} 123 or 123 <!-- swig 0 --> 123.

@D-Sketon D-Sketon merged commit dbf1ce1 into hexojs:master Feb 12, 2025
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants