提交 3aa13058 编写于 作者: C campaign

修复pre中html被转义的问题

上级 1619ffff
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
}; };
var notTransTagName = { var notTransTagName = {
pre:1,
style:1, style:1,
script:1 script:1
}; };
...@@ -116,7 +115,13 @@ ...@@ -116,7 +115,13 @@
} }
function isText(node, arr) { function isText(node, arr) {
arr.push(notTransTagName[node.parentNode.tagName] ? utils.html(node.data) : node.data.replace(/[ ]{2}/g,'  ')) if(node.parentNode.tagName == 'pre'){
//源码模式下输入html标签,不能做转换处理,直接输出
arr.push(node.data)
}else{
arr.push(notTransTagName[node.parentNode.tagName] ? utils.html(node.data) : node.data.replace(/[ ]{2}/g,'  '))
}
} }
function isElement(node, arr, formatter, current) { function isElement(node, arr, formatter, current) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册