parent
ce1552f344
commit
c4efa0df80
@ -0,0 +1,38 @@
|
|||||||
|
import React, { Component } from 'react';
|
||||||
|
import {markdownToHTML} from 'educoder';
|
||||||
|
|
||||||
|
class Showmarkdown extends Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
componentDidMount() {
|
||||||
|
|
||||||
|
if (this.props.descriptions) {
|
||||||
|
setTimeout(()=>{
|
||||||
|
var shixunDescr = window.editormd.markdownToHTML("memo_content_editorMd", {
|
||||||
|
htmlDecode: "style,script,iframe", // you can filter tags decode
|
||||||
|
taskList: true,
|
||||||
|
tex: true, // 默认不解析
|
||||||
|
flowChart: true, // 默认不解析
|
||||||
|
sequenceDiagram: true // 默认不解析
|
||||||
|
});
|
||||||
|
}, 200)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
|
||||||
|
return(
|
||||||
|
<div id="memo_content_editorMd" className="new_li">
|
||||||
|
<textarea style={{'display': 'none'}}>
|
||||||
|
{this.props.descriptions}
|
||||||
|
</textarea>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Showmarkdown;
|
Loading…
Reference in new issue