Commit f39805dd by yuananting

fix:bug修复

parent 3f8abeb5
...@@ -119,6 +119,7 @@ class QuestionEditor extends Component { ...@@ -119,6 +119,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 = false;
editorRoot.config.focus = false;
// 自定义处理粘贴的文本内容 // 自定义处理粘贴的文本内容
editorRoot.config.pasteTextHandle = function (content) { editorRoot.config.pasteTextHandle = function (content) {
if (content == "" && !content) return ""; if (content == "" && !content) return "";
...@@ -218,14 +219,10 @@ class QuestionEditor extends Component { ...@@ -218,14 +219,10 @@ class QuestionEditor extends Component {
); );
}; };
editorRoot.config.onblur = (html) => { editorRoot.config.onblur = () => {
html = html.replace(/<(?!img|input).*?>/g, "");
html = html.replace(/\s+/g, "");
const conLen = html.length;
this.setState({ this.setState({
focusFlag: false, focusFlag: false,
visibleMediaBox: false, visibleMediaBox: false,
visiblePlacehold: conLen === 0,
zIndex: 9, zIndex: 9,
}); });
}; };
...@@ -300,6 +297,7 @@ class QuestionEditor extends Component { ...@@ -300,6 +297,7 @@ class QuestionEditor extends Component {
limitLength = 1000, limitLength = 1000,
markKey, markKey,
} = this.props; } = this.props;
console.log("visiblePlacehold", visiblePlacehold)
return ( return (
<div <div
className={`question-edtior_box question-edtior_box__${markKey}`} className={`question-edtior_box question-edtior_box__${markKey}`}
......
...@@ -225,6 +225,7 @@ class QuestionPreviewModal extends Component { ...@@ -225,6 +225,7 @@ class QuestionPreviewModal extends Component {
)} )}
{["JUDGE"].includes(questionTypeEnum) && {["JUDGE"].includes(questionTypeEnum) &&
_.map(questionOptionContentList, (item, index) => { _.map(questionOptionContentList, (item, index) => {
item.content = item.content.replace(/<\/?[^>]*>/g, "");
return <span key={index}>{item.content}</span>; return <span key={index}>{item.content}</span>;
})} })}
</div> </div>
......
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