simplemde

How to set html content as value in simpleMDE texteditor in Angular2

雨燕双飞 提交于 2019-12-11 07:59:52
问题 I am having value which contains HTML tags in it. I want to render it as initial value of SimpleMDE editor. I have tried simplemde.value(content) But it just render it as simple RAW data with all the HTML tags displaying in texteditor field area. If possible suggest some solution compatible with angular2. 来源: https://stackoverflow.com/questions/43084091/how-to-set-html-content-as-value-in-simplemde-texteditor-in-angular2

How to add a custom Markdown function to SimpleMDE?

杀马特。学长 韩版系。学妹 提交于 2019-12-05 14:47:42
问题 Currently using this Markdown WYSIWYG editor. I needed to extend Markdown with one function ( !!text!! to create red text) and have successfully done so on the server side, but as one who struggles with JavaScript, I'm having difficulty doing the same for this library. 回答1: Try this: var myEditor = new SimpleMDE({ toolbar: [ { name: "redText", action: drawRedText, className: "fa fa-bold", // Look for a suitable icon title: "Red text (Ctrl/Cmd-Alt-R)", } ] }); function drawRedText(editor) {

How to add a custom Markdown function to SimpleMDE?

*爱你&永不变心* 提交于 2019-12-04 00:54:16
Currently using this Markdown WYSIWYG editor. I needed to extend Markdown with one function ( !!text!! to create red text) and have successfully done so on the server side, but as one who struggles with JavaScript, I'm having difficulty doing the same for this library. Try this: var myEditor = new SimpleMDE({ toolbar: [ { name: "redText", action: drawRedText, className: "fa fa-bold", // Look for a suitable icon title: "Red text (Ctrl/Cmd-Alt-R)", } ] }); function drawRedText(editor) { var cm = editor.codemirror; var output = ''; var selectedText = cm.getSelection(); var text = selectedText ||