[\s\S]*?<\/table>/i.test(content);
@@ -1765,7 +2147,6 @@ export default {
return false;
}
var list = this.$commonJS.cleanAndParseWordContent(content);
-
this.saveContentList(list, this.currentId);
} else if (type == 'table') {
@@ -1814,8 +2195,6 @@ export default {
},
async saveContent(content, am_id) {
-
-
const loading = this.$loading({
lock: true,
text: 'Loading...',
@@ -1825,8 +2204,8 @@ export default {
var that = this;
var str = content.replace(/^\s*(.*?)\s*<\/p>$/, '$1').trim();
- str = str.replace(/
/gi, '');
-
+ str = str.replace(/
/gi, '');
+
str = await that.$commonJS.decodeHtml(str);
/** 点 Save 立即按将写入的正文重排下方列表(不等待接口),与弹窗内 [n] 一致 */
@@ -1935,7 +2314,6 @@ export default {
}
},
saveLateX(data) {
-
// 1. 从 data 中解构出 wrap (或者你命名的模式变量)
const { editorId, wmathId, latex, wrap } = data;
const newLatex = latex ? latex.trim() : '';
@@ -2191,7 +2569,6 @@ export default {
});
},
async addCommentSetting(content) {
-
await this.$api
.post(this.urlList.addComment, {
am_id: content.am_id,
@@ -2214,10 +2591,9 @@ export default {
});
},
async addComment(content) {
-
- var str= this.$commonJS.transformHtmlString(content)
- str=str.replace(/
/gi, '');
- console.log("🚀 ~ addComment ~ content:", str);
+ var str = this.$commonJS.transformHtmlString(content);
+ str = str.replace(/
/gi, '');
+ console.log('🚀 ~ addComment ~ content:', str);
if (str == '') {
this.$message({
type: 'warning',
@@ -2299,13 +2675,12 @@ export default {
this.getCommentList();
},
editComment(comment, type) {
-
this.commentForm = {
...comment,
type: type,
remark: type == 'user' ? comment.author_remark : comment.remark
};
-
+
this.commentVisible = true;
},
async onAddComment(data) {
@@ -2425,7 +2800,6 @@ export default {
});
// 处理文件上传并传递回调函数
this.$commonJS.handleFileUpload(event, function (tables) {
-
if (tables.length == 0) {
loading.close();
that.$message({
@@ -2675,7 +3049,6 @@ export default {
}
},
updateChange(content, type) {
-
var str = this.$commonJS.transformHtmlString(content);
if (type == 'imgNote') {
this.picStyle1.note = str;
@@ -2965,8 +3338,6 @@ export default {
// 确定保存图片
async savePic() {
var str = this.picStyle1.note ? await this.$commonJS.decodeHtml(this.picStyle1.note) : '';
-
-
var titleStr = this.picStyle1.title ? await this.$commonJS.decodeHtml(this.picStyle1.title) : '';
@@ -3157,45 +3528,46 @@ export default {
}
},
async saveTable(content) {
-
const cleanTableData = (tableList) => {
- if (tableList.length == 0) {
- return [];
- } else {
- // 定义清理函数:去掉所有 br 标签和 TinyMCE 占位符
- const cleanText = (text) => {
- if (!text) return "";
- // return text.replace(/
/gi, '').trim();
- return text
- };
+ if (tableList.length == 0) {
+ return [];
+ } else {
+ // 定义清理函数:去掉所有 br 标签和 TinyMCE 占位符
+ const cleanText = (text) => {
+ if (!text) return '';
+ // return text.replace(/
/gi, '').trim();
+ return text;
+ };
- // 1. 获取处理后的干净表头
- const header = tableList[0].map(cell => ({
- ...cell,
- text: cleanText(cell.text)
- }));
+ // 1. 获取处理后的干净表头
+ const header = tableList[0].map((cell) => ({
+ ...cell,
+ text: cleanText(cell.text)
+ }));
- // 2. 过滤逻辑
- const cleanedTable = tableList.map((row) => {
- // 首先:把每一行里的每个 cell.text 里的
都去掉
- return row.map(cell => ({
- ...cell,
- text: cleanText(cell.text)
- }));
- }).filter((row, index) => {
- if (index === 0) return true;
+ // 2. 过滤逻辑
+ const cleanedTable = tableList
+ .map((row) => {
+ // 首先:把每一行里的每个 cell.text 里的
都去掉
+ return row.map((cell) => ({
+ ...cell,
+ text: cleanText(cell.text)
+ }));
+ })
+ .filter((row, index) => {
+ if (index === 0) return true;
- // 3. 此时比较的就是没有
的文本了
- const isHeaderRow = row.every((cell, cellIndex) => {
- return cell.text === header[cellIndex].text;
- });
+ // 3. 此时比较的就是没有
的文本了
+ const isHeaderRow = row.every((cell, cellIndex) => {
+ return cell.text === header[cellIndex].text;
+ });
- return !isHeaderRow;
- });
+ return !isHeaderRow;
+ });
- return cleanedTable;
- }
-};
+ return cleanedTable;
+ }
+ };
var cleanedTableList = content.table ? content.table : [];
cleanedTableList = cleanTableData(content.table);
@@ -3221,8 +3593,8 @@ export default {
});
strNote = strNote.replace(/
/gi, '');
strTitle = strTitle.replace(/
/gi, '');
- var tableStr=JSON.stringify(cleanedTableList)
-
+ var tableStr = JSON.stringify(cleanedTableList);
+
if (this.lineStyle.visiTitle == 'Edit Table') {
this.$api
.post(this.urlList.editTable, {
@@ -3808,7 +4180,8 @@ wmath[data-wrap='inline'] {
background-color: rgb(252, 98, 93);
background-color: rgb(252 98 93 / 68%);
color: #333;
-}.status {
+}
+.status {
display: block;
width: 36px;
height: 36px;
@@ -3828,8 +4201,7 @@ wmath[data-wrap='inline'] {
}
.status.float {
- display:
- inline-block;
+ display: inline-block;
}
.doiLink {
color: #409eff;
diff --git a/src/components/page/components/Tinymce/index.vue b/src/components/page/components/Tinymce/index.vue
index 1085785..e4166c5 100644
--- a/src/components/page/components/Tinymce/index.vue
+++ b/src/components/page/components/Tinymce/index.vue
@@ -432,8 +432,17 @@ export default {
let lastIndex = 0;
const pieces = [];
let replaced = 0;
+ let skippedSpecial = 0;
while ((m = re.exec(text)) !== null) {
const nums = this.parseBracketInnerToNumbers(m[1]);
+ // 规则:只要括号里包含 0 或 -1,这一段不做解析替换(但不影响其它正常 [1][2])
+ if (nums.some((n) => n === 0 || n === -1)) {
+ pieces.push({ type: 'text', s: text.slice(lastIndex, m.index) });
+ pieces.push({ type: 'text', s: m[0] });
+ lastIndex = m.index + m[0].length;
+ skippedSpecial++;
+ continue;
+ }
const ids = [];
const seen = new Set();
nums.forEach((n) => {
@@ -470,6 +479,13 @@ export default {
}
});
parent.replaceChild(frag, textNode);
+ if (skippedSpecial > 0) {
+ // 提示:仅提示一次即可;这里在节点级别提示可能重复,放到宏任务末尾合并展示
+ clearTimeout(this._autoLinkSkipToastTimer);
+ this._autoLinkSkipToastTimer = setTimeout(() => {
+ this.$message.info(`Skipped ${skippedSpecial} bracket cite(s) containing 0/-1.`);
+ }, 0);
+ }
return replaced;
},
renderAutociteInEditor(ed) {
diff --git a/src/components/page/components/table/word.vue b/src/components/page/components/table/word.vue
index 4413257..74d01ef 100644
--- a/src/components/page/components/table/word.vue
+++ b/src/components/page/components/table/word.vue
@@ -3679,8 +3679,8 @@ renderCiteLabels(html) {
text = this.highlightText3(raw, [], type, item.am_id);
}
} else {
- // 预览与编辑「显示批注」同源:先切 wmath/autocite、再 renderCiteLabels,避免仅跑片段导致角标/公式不一致
- text = this.highlightText1(String(raw || ''), annotations || [], type);
+ // 预览:仅正文+角标+公式,不传批注(highlightText1 内 isPreview 会跳过 remarkbg)
+ text = this.highlightText1(String(raw || ''), [], type);
}
// const finalHtml = text.replace(/<(?!(\/?(span|p|div|table|tr|td|th|b|i|strong|em|ul|ol|li|br|img|myh3|myfigure|mytable|blue|wmath)))/gi, '<');
@@ -3821,6 +3821,16 @@ renderCiteLabels(html) {
}
if (lastIdx < src.length) parts.push({ type: 'plain', html: src.slice(lastIdx) });
+ // 预览:只拼回正文与公式块,再 renderCiteLabels;不批注高亮、不做 AI/批注占位
+ if (this.isPreview) {
+ let htmlPrev = parts.map((p) => p.html).join('');
+ htmlPrev = this.renderCiteLabels(htmlPrev);
+ if (type === 0 && htmlPrev.trim() === '') {
+ htmlPrev += `
`;
+ }
+ return htmlPrev;
+ }
+
// 2) 预处理批注(用 annotation.content)
const anns = (annotations || [])
.map((a, i) => ({
@@ -4945,7 +4955,7 @@ renderCiteLabels(html) {
}
.proofreading-num {
z-index: 2;
- background: #0082aa;
+ background: #e61a12;
color: rgb(255, 255, 255);
border-radius: 20px;
padding: 0px 6px;