fix(escapeAllSwigTags): Prevent swig tag prefix collision during esca…#5636
Open
zombie12138 wants to merge 1 commit intohexojs:masterfrom
Open
fix(escapeAllSwigTags): Prevent swig tag prefix collision during esca…#5636zombie12138 wants to merge 1 commit intohexojs:masterfrom
zombie12138 wants to merge 1 commit intohexojs:masterfrom
Conversation
How to testgit clone -b hotfix/swig-tag-conflict https://github.com/zombie12138/hexo.git
cd hexo
npm install
npm test |
9d0b5e9 to
5483a3b
Compare
5 tasks
Pull Request Test Coverage Report for Build 14007045798Details
💛 - Coveralls |
6134a97 to
de619bb
Compare
SukkaW
requested changes
Mar 22, 2025
| const { env } = this; | ||
|
|
||
| if (env.hasExtension(name)) env.removeExtension(name); | ||
| delete this.block_swig_tag_map[name]; |
Member
There was a problem hiding this comment.
Why not this.block_swig_tag_map[name] = false?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does it do?
fix bug in #5635
When a non-block Swig tag (Tag A) shares a prefix for a block-level tag (Tag B), such as non-block
reftag and block-levelreferencestag,escapeAllSwigTagswill mistakenly identify tag A (refin my case) as a block-level tag, and escape all content between{% tag %}and{% endreferences %}, leading to unrendered content.This pull request resolves this case by implementing a block tag registry table. This methodology achieves maximum precision, but it introduces increased code coupling as an implementation trade-off.
Screenshots
Pull request tasks