-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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): check tag completeness #5395
Conversation
How to testgit clone -b escape https://github.com/uiolee/hexo.git
cd hexo
npm install
npm test |
Pull Request Test Coverage Report for Build 7554903652
💛 - Coveralls |
lib/hexo/post.ts
Outdated
state = STATE_SWIG_VAR; | ||
idx++; | ||
} else if (next_char === '#') { | ||
} else if (next_char === '#' && /\{#.+?#\}/.test(str)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the change, we will run regexp.test
again and again for every character inside str
.
The .test
should be hoist to the top of the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, I have updated it
7.1 没有完全修复,解析下面代码会报错。7.0 反而解析正常。 Version 7.1 is not fully fixed; parsing the following code will result in an error. Surprisingly, parsing is normal in version 7.0
err log
|
7.1版本不止上面这一个tag 报错,7.0反而正常 |
见 #5401,和换行有关 |
那个issue看过,找到这里来的 文章太多,不可能一个个tag修改过去, 只能先降级到7.0版本使用了。等待后面修复 |
What does it do?
fix #5301
fix hexojs/hexo-renderer-pandoc#60
Before escape tags, check if it contains a complete tag.
In others words, just escape complete tags.
Screenshots
Pull request tasks