提交
This commit is contained in:
@@ -843,7 +843,7 @@ export default {
|
||||
// 使用正则表达式删除属性(保留 data-latex)
|
||||
let updatedAttributes = attributes.replace(/\s([a-zA-Z0-9-]+)(="[^"]*")?/g, function (attrMatch, attrName) {
|
||||
|
||||
if (attrName === "data-latex") {
|
||||
if (attrName === "data-latex" || attrName === "data-id") {
|
||||
return attrMatch;
|
||||
}
|
||||
if (type == 'table' && tag == 'img' && (attrName === "src" || attrName === "width" || attrName === "height")) {
|
||||
@@ -856,9 +856,9 @@ export default {
|
||||
});
|
||||
// 2. 删除所有不需要的标签 (除 `strong`, `em`, `sub`, `sup`, `b`, `i` 外的所有标签)
|
||||
if (type == 'table') {
|
||||
inputHtml = inputHtml.replace(/<(?!\/?(strong|em|sub|sup|b|i|blue|wmath|img))[^>]+>/g, ''); // 删除不需要的标签
|
||||
inputHtml = inputHtml.replace(/<(?!\/?(strong|em|sub|sup|b|i|blue|wmath|img|myfigure|mytable))[^>]+>/g, ''); // 删除不需要的标签
|
||||
} else {
|
||||
inputHtml = inputHtml.replace(/<(?!\/?(strong|em|sub|sup|b|i|blue|wmath))[^>]+>/g, ''); // 删除不需要的标签
|
||||
inputHtml = inputHtml.replace(/<(?!\/?(strong|em|sub|sup|b|i|blue|wmath|myfigure|mytable))[^>]+>/g, ''); // 删除不需要的标签
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,20 +34,20 @@ function throttle(fn, delay = 1000, immediate = false) {
|
||||
let args = arguments
|
||||
|
||||
if (immediate) {
|
||||
console.log("立即执行参数 执行一次方法")
|
||||
|
||||
fn.apply(_this, args)
|
||||
immediate = false
|
||||
return
|
||||
}
|
||||
if (status) {
|
||||
console.log("当前点击状态为正在重复点击,请稍等片刻后在点击执行")
|
||||
|
||||
return
|
||||
}
|
||||
console.log("执行节流:当前执行了一次点击方法")
|
||||
|
||||
fn.apply(_this, args)
|
||||
status = true // 修改状态
|
||||
timer = setTimeout(() => {
|
||||
console.log("规定时间到,重置状态,可以重新调用")
|
||||
|
||||
status = false
|
||||
}, delay)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user