修改markdown编辑器
This commit is contained in:
parent
45247e6a03
commit
6a552fd2d5
|
@ -558,20 +558,21 @@
|
|||
|
||||
_this.setToolbar();
|
||||
|
||||
// editormd.loadScript(loadPath + "marked.min", function () {
|
||||
// });
|
||||
// 此处影响公式加载
|
||||
editormd.loadScript(loadPath + "marked.min", function () {
|
||||
|
||||
editormd.$marked = marked;
|
||||
editormd.$marked = marked;
|
||||
|
||||
if (settings.previewCodeHighlight) {
|
||||
editormd.loadScript(loadPath + "prettify.min", function () {
|
||||
if (settings.previewCodeHighlight) {
|
||||
editormd.loadScript(loadPath + "prettify.min", function () {
|
||||
loadFlowChartOrSequenceDiagram();
|
||||
});
|
||||
}
|
||||
else {
|
||||
loadFlowChartOrSequenceDiagram();
|
||||
});
|
||||
}
|
||||
else {
|
||||
loadFlowChartOrSequenceDiagram();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
@ -1434,7 +1435,7 @@
|
|||
var tex = $(this);
|
||||
editormd.$katex.render(tex.text(), tex[0]);
|
||||
|
||||
tex.find(".katex").css("font-size", "1.0em");
|
||||
tex.find(".katex").css("font-size", "1.6em");
|
||||
});
|
||||
|
||||
return this;
|
||||
|
@ -3810,7 +3811,7 @@
|
|||
div.find("." + editormd.classNames.tex).each(function () {
|
||||
var tex = $(this);
|
||||
katex.render(tex.text(), tex[0]);
|
||||
tex.find(".katex").css("font-size", "1.0em");
|
||||
tex.find(".katex").css("font-size", "1.6em");
|
||||
});
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
11
src/App.css
11
src/App.css
|
@ -33,7 +33,13 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* md样式 */
|
||||
.editormd-fullscreen{
|
||||
z-index: 9999;
|
||||
}
|
||||
.editormd-menu>li:last-child{
|
||||
float: right;
|
||||
}
|
||||
/* 控制md编辑器列行的宽度
|
||||
见 codermirror maybeUpdateLineNumberWidth方法
|
||||
*/
|
||||
|
@ -94,7 +100,7 @@ body {
|
|||
border-left: 1px solid rgb(221, 221, 221);
|
||||
/* 某些情况下,被cm盖住了 */
|
||||
z-index: 99;
|
||||
padding:8px 8px 50px;
|
||||
padding: 0 8px;
|
||||
}
|
||||
.editormd-preview .markdown-body{
|
||||
padding:0px !important;
|
||||
|
@ -118,7 +124,6 @@ body {
|
|||
padding: 0 12px;
|
||||
}
|
||||
|
||||
|
||||
/* antd扩展 */
|
||||
.formItemInline.ant-form-item {
|
||||
display: flex;
|
||||
|
|
|
@ -99,7 +99,7 @@ li {
|
|||
|
||||
pre.prettyprint {
|
||||
border: 0px solid transparent;
|
||||
padding: 10px;
|
||||
padding: 10px 38px;
|
||||
}
|
||||
|
||||
.-flex-basic0 {
|
||||
|
|
|
@ -313,7 +313,7 @@ export default class TPMMDEditor extends Component {
|
|||
}
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className={`df ${className} ${imageExpand && 'editormd-image-click-expand'}`} >
|
||||
<div className={`df editormd-editing ${className} ${imageExpand && 'editormd-image-click-expand'}`} >
|
||||
{/* padding10-20 */}
|
||||
<div className="edu-back-greyf5 radius4" id={`mdEditor_${mdID}`} style={{ ..._style }}>
|
||||
<textarea style={{ display: 'none' }} id={`mdEditors_${mdID}`} name="content"></textarea>
|
||||
|
|
|
@ -9,7 +9,7 @@ import 'codemirror/lib/codemirror.css';
|
|||
import './css/newquestion.css';
|
||||
const $ = window.$
|
||||
|
||||
const mdIcons = ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "link", "|", "inline-latex", "latex", '|', "image", "table", '|', "line-break", "watch", "clear"];
|
||||
const mdIcons = ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "link", "|", "inline-latex", "latex", '|', "image", "table", '|', "line-break", "watch", "clear","fullscreen"];
|
||||
|
||||
const NULL_CH = '▁';
|
||||
|
||||
|
@ -289,7 +289,8 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
|
|||
setEditorInstance(this)
|
||||
}
|
||||
})
|
||||
|
||||
console.log('editor_instance');
|
||||
console.log(editor_instance);
|
||||
|
||||
}, [containerId, editorInstance, startInit])
|
||||
|
||||
|
@ -566,7 +567,7 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
|
|||
return (
|
||||
<Fragment>
|
||||
{atWhoVisible && atWhoList}
|
||||
<div ref={editorEl} className={`df ${className} ${imageExpand && 'editormd-image-click-expand'} `}>
|
||||
<div ref={editorEl} className={`df editormd-editing ${className} ${imageExpand && 'editormd-image-click-expand'} `}>
|
||||
<div className={`edu-back-greyf5 radius4 editormd ${error ? 'error' : ''}`} id={containerId} >
|
||||
<textarea style={{ display: 'none' }} id={editorBodyId} name="content"></textarea>
|
||||
<div className="CodeMirror cm-s-defualt"></div>
|
||||
|
|
Loading…
Reference in New Issue