优化code组件的渲染
parent
d47c6e5c13
commit
30a8738092
|
@ -194,7 +194,9 @@ class Code extends Component {
|
||||||
txt = colorMd(txt)
|
txt = colorMd(txt)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
// 除代码高亮用的特殊标签 <c></c> 外, 其他的全部转义
|
||||||
|
// 避免渲染时混乱
|
||||||
|
txt = txt.replace(/<(\/?)(?!c)(\w+)([^>]*?)>/g, '<$1$2$3>')
|
||||||
this.#code = txt.split('\n')
|
this.#code = txt.split('\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue