Commit 274326c1 by yuananting

fix:表格题干一行显示,多余省略

parent 7f16d54a
...@@ -120,7 +120,7 @@ class QuestionEditor extends Component { ...@@ -120,7 +120,7 @@ class QuestionEditor extends Component {
}; };
editorRoot.config.zIndex = 999; editorRoot.config.zIndex = 999;
editorRoot.config.placeholder = ""; editorRoot.config.placeholder = "";
editorRoot.config.pasteFilterStyle = false; editorRoot.config.pasteFilterStyle = true;
editorRoot.config.pasteIgnoreImg = true; editorRoot.config.pasteIgnoreImg = true;
editorRoot.config.focus = false; editorRoot.config.focus = false;
// 自定义处理粘贴的文本内容 // 自定义处理粘贴的文本内容
...@@ -129,7 +129,6 @@ class QuestionEditor extends Component { ...@@ -129,7 +129,6 @@ class QuestionEditor extends Component {
var str1 = content; // 所有特殊字符 var str1 = content; // 所有特殊字符
str1 = str1.replace(/<xml>[\s\S]*?<\/xml>/gi, ""); str1 = str1.replace(/<xml>[\s\S]*?<\/xml>/gi, "");
str1 = str1.replace(/<style>[\s\S]*?<\/style>/gi, ""); str1 = str1.replace(/<style>[\s\S]*?<\/style>/gi, "");
str1 = str1.replace(/style\s*?=\s*?([‘"])[\s\S]*?\1/gi, "");
str1 = str1.replace(/<\/?[^>]*>/g, ""); str1 = str1.replace(/<\/?[^>]*>/g, "");
str1 = str1.replace(/[ | ]*\n/g, "\n"); str1 = str1.replace(/[ | ]*\n/g, "\n");
str1 = str1.replace(/\&nbsp\;/gi, " "); str1 = str1.replace(/\&nbsp\;/gi, " ");
...@@ -137,7 +136,6 @@ class QuestionEditor extends Component { ...@@ -137,7 +136,6 @@ class QuestionEditor extends Component {
var str2 = content; // 保留空格和换行的其他字符 var str2 = content; // 保留空格和换行的其他字符
str2 = str2.replace(/<xml>[\s\S]*?<\/xml>/gi, ""); str2 = str2.replace(/<xml>[\s\S]*?<\/xml>/gi, "");
str2 = str2.replace(/<style>[\s\S]*?<\/style>/gi, ""); str2 = str2.replace(/<style>[\s\S]*?<\/style>/gi, "");
str2 = str2.replace(/style\s*?=\s*?([‘"])[\s\S]*?\1/gi, "");
if (editorRoot.txt.text().length + str1.length > 1000) { if (editorRoot.txt.text().length + str1.length > 1000) {
content = str2.substring(0, 1000); content = str2.substring(0, 1000);
message.error("内容过长,不能超过1000字"); message.error("内容过长,不能超过1000字");
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 11:23:47 * @Date: 2021-02-25 11:23:47
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-05-18 15:25:40 * @LastEditTime: 2021-05-18 16:10:49
* @Description: 助学工具-题库-题目列表数据 * @Description: 助学工具-题库-题目列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -241,6 +241,7 @@ class QuestionList extends Component { ...@@ -241,6 +241,7 @@ class QuestionList extends Component {
overlayStyle={{ maxWidth: 700 }} overlayStyle={{ maxWidth: 700 }}
> >
<div <div
className="one-line-text"
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: handleVal, __html: handleVal,
}} }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment