-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
调用 setMarkdown() 方法之后,代码没有语法高亮 #24
Comments
我这边试了可以呀 |
嗯,试了一下,我这边Win7 + Chrome 39也不行,Change时没有及时加上代码高亮的样式类class="prettyprint linenums prettyprinted"。先标记一下,稍后一并修复。 |
@v1.1.6 fixed. |
<script type="text/javascript">
var temp = "{{ content }}";
document.write(temp);
$(function () {
var testEditor = editormd("editormd", {
width: "100%",
height: 640,
syncScrolling: "single",
saveHTMLToTextarea: true,
path: "{{url_for('static', filename='editor.md/lib/')}}",
htmlDecode : true ,
onload: function(){
// alert("onload");
this.setMarkdown(temp);
// console.log("onload =>", this, this.id, this.settings);
}
});
});
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Chrome 浏览器访问 https://pandao.github.io/editor.md/examples/full.html
打开console, 执行:
testEditor.setMarkdown("\tfunction test() {\n\t\talert('test');\n\t}");
HTML实时预览那里,代码没有语法高亮。
随便敲个回车空格之类的,触发onChange事件, 就有语法高亮了。
The text was updated successfully, but these errors were encountered: