审稿录入Latex
This commit is contained in:
@@ -420,7 +420,8 @@
|
||||
</p>
|
||||
<p v-if="item1.comments!=''">
|
||||
<font>Comments for the Authors</font>
|
||||
<pre>{{item1.comments}}</pre>
|
||||
<p v-html="getHtmlValue(item1.comments)"></p>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -474,7 +475,8 @@
|
||||
|
||||
<p v-if="item.suggest_for_author!=''" style="margin-left: 0;">
|
||||
<font style="margin-top: 0px;">Comments for the Authors</font>
|
||||
<pre style="text-align: justify;">{{item.suggest_for_author}}</pre>
|
||||
<p v-html="getHtmlValue(item.suggest_for_author)"></p>
|
||||
<!-- <pre style="text-align: justify;">{{item.suggest_for_author}}</pre> -->
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -537,6 +539,55 @@
|
||||
this.getdate();
|
||||
},
|
||||
methods: {
|
||||
formatToHtml(val) {
|
||||
|
||||
if (!val) return '';
|
||||
|
||||
|
||||
|
||||
// 1. 创建临时的 textarea。目的是利用浏览器标准化的能力处理 \n
|
||||
|
||||
const tempTextArea = document.createElement('textarea');
|
||||
|
||||
tempTextArea.value = val;
|
||||
|
||||
|
||||
|
||||
// 此时 text 里的换行符已经被统一为 \n
|
||||
|
||||
let text = tempTextArea.value;
|
||||
|
||||
|
||||
|
||||
// 2. 处理换行:将 \n 转换为 <br>
|
||||
|
||||
// 这样能确保你那 8 条审稿意见能正确分行
|
||||
|
||||
let processedText = text.replace(/\n/g, '<br>');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return processedText;
|
||||
|
||||
},
|
||||
getHtmlValue(val){
|
||||
|
||||
// const formula = '<wmath data-id=\"wmath-7g5e4ycyj\" data-latex=\"$$\\sqrt{a^2 + b^2}$$\" data-wrap=\"block\">a2+b2</wmath>';
|
||||
|
||||
var str = `${val}`;
|
||||
|
||||
setTimeout(() => {
|
||||
if (window.renderMathJax) window.renderMathJax();
|
||||
}, 500);
|
||||
return str ? this.formatToHtml(str) : '';
|
||||
|
||||
|
||||
},
|
||||
//初始化期刊选项
|
||||
initselect() {
|
||||
this.$api
|
||||
@@ -1174,4 +1225,15 @@ this.$router.push({
|
||||
/deep/.research_area .el-collapse-item__content{
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
::v-deep wmath {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
|
||||
|
||||
}
|
||||
::v-deep wmath[data-wrap="inline"] {
|
||||
display: inline-block !important;
|
||||
width: auto !important;
|
||||
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user