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: comment has encoded #257

Merged
merged 1 commit into from
May 27, 2022
Merged

Conversation

lumburr
Copy link
Contributor

@lumburr lumburr commented Apr 2, 2022

close #230

lib/default.js Outdated
@@ -344,10 +355,12 @@ function onIgnoreTagStripAll() {
*/
function StripTagBody(tags, next) {
if (typeof next !== "function") {
next = function () {};
next = function () {
};
}
Copy link
Owner

Choose a reason for hiding this comment

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

这里的修改与本次要修复的问题无关

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -228,6 +237,8 @@ function safeAttrValue(tag, name, value, cssFilter) {
// RegExp list
var REGEXP_LT = /</g;
var REGEXP_GT = />/g;
var REGEXP_LT_NOT_COMMENT = /<(?!!--)/g;
var REGEXP_RT_NOT_COMMENT = /(?<!--)>/g;
Copy link
Owner

Choose a reason for hiding this comment

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

正则表达式 /(?<!--)>/g 在 Safari 上会报错 SyntaxError: Invalid regular expression: invalid group specifier name,原因是 Safari 不支持 negative lookbehind

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.

HTML comment tags are encoded
2 participants