修正:当启用stripIgnoreTagBody时,如果以要过滤的标签开头,会导致前面部分没正确删除[removed]标记
This commit is contained in:
@@ -278,7 +278,7 @@ function StripTagBody (tags, next) {
|
||||
var isRemoveAllTag = !Array.isArray(tags);
|
||||
function isRemoveTag (tag) {
|
||||
if (isRemoveAllTag) return true;
|
||||
return tags.indexOf(tag) !== -1;
|
||||
return (tags.indexOf(tag) !== -1);
|
||||
}
|
||||
|
||||
var removeList = []; // 要删除的位置范围列表
|
||||
@@ -290,7 +290,7 @@ function StripTagBody (tags, next) {
|
||||
if (options.isClosing) {
|
||||
var ret = '[/removed]';
|
||||
var end = options.position + ret.length;
|
||||
removeList.push([posStart || options.position, end]);
|
||||
removeList.push([posStart !== false ? posStart : options.position, end]);
|
||||
posStart = false;
|
||||
return ret;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user