fix: 更新 editor.md 的 JS 文件,修复部分场景下解析失败的情况
This commit is contained in:
parent
33e1a79ad2
commit
67be51f9a6
@ -3901,6 +3901,13 @@
|
|||||||
|
|
||||||
if (typeof attrs !== "undefined")
|
if (typeof attrs !== "undefined")
|
||||||
{
|
{
|
||||||
|
// 将 html 标签的 attr value 中存在的 <> 进行转义
|
||||||
|
// 示例 <a name="<p>code</p>"></a> 替换为 <a name="<p>code</p>"></a>
|
||||||
|
html = html.replace(/(\w+)="([^"]*)"/g, (match, key, value) => {
|
||||||
|
const escapedValue = value.replace(/</g, '<').replace(/>/g, '>');
|
||||||
|
return `${key}="${escapedValue}"`;
|
||||||
|
});
|
||||||
|
|
||||||
var htmlTagRegex = /\<(\w+)\s*([^\>]*)\>([^\>]*)\<\/(\w+)\>/ig;
|
var htmlTagRegex = /\<(\w+)\s*([^\>]*)\>([^\>]*)\<\/(\w+)\>/ig;
|
||||||
|
|
||||||
if (attrs === "*")
|
if (attrs === "*")
|
||||||
|
|||||||
@ -3832,6 +3832,13 @@
|
|||||||
|
|
||||||
if (typeof attrs !== "undefined")
|
if (typeof attrs !== "undefined")
|
||||||
{
|
{
|
||||||
|
// 将 html 标签的 attr value 中存在的 <> 进行转义
|
||||||
|
// 示例 <a name="<p>code</p>"></a> 替换为 <a name="<p>code</p>"></a>
|
||||||
|
html = html.replace(/(\w+)="([^"]*)"/g, (match, key, value) => {
|
||||||
|
const escapedValue = value.replace(/</g, '<').replace(/>/g, '>');
|
||||||
|
return `${key}="${escapedValue}"`;
|
||||||
|
});
|
||||||
|
|
||||||
var htmlTagRegex = /\<(\w+)\s*([^\>]*)\>([^\>]*)\<\/(\w+)\>/ig;
|
var htmlTagRegex = /\<(\w+)\s*([^\>]*)\>([^\>]*)\<\/(\w+)\>/ig;
|
||||||
|
|
||||||
if (attrs === "*")
|
if (attrs === "*")
|
||||||
|
|||||||
@ -3822,6 +3822,13 @@
|
|||||||
|
|
||||||
if (typeof attrs !== "undefined")
|
if (typeof attrs !== "undefined")
|
||||||
{
|
{
|
||||||
|
// 将 html 标签的 attr value 中存在的 <> 进行转义
|
||||||
|
// 示例 <a name="<p>code</p>"></a> 替换为 <a name="<p>code</p>"></a>
|
||||||
|
html = html.replace(/(\w+)="([^"]*)"/g, (match, key, value) => {
|
||||||
|
const escapedValue = value.replace(/</g, '<').replace(/>/g, '>');
|
||||||
|
return `${key}="${escapedValue}"`;
|
||||||
|
});
|
||||||
|
|
||||||
var htmlTagRegex = /\<(\w+)\s*([^\>]*)\>([^\>]*)\<\/(\w+)\>/ig;
|
var htmlTagRegex = /\<(\w+)\s*([^\>]*)\>([^\>]*)\<\/(\w+)\>/ig;
|
||||||
|
|
||||||
if (attrs === "*")
|
if (attrs === "*")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user