当前位置: 移动技术网 > IT编程>开发语言>JavaScript > markdown编辑器的使用

markdown编辑器的使用

2020年08月10日  | 移动技术网IT编程  | 我要评论
markdown编辑器的下载和使用记得选排名前几的<section id="global"> <div style=" min-height: 700px;" class="container-fluid cm-container-white"> <div id="test-editormd"> <textarea style="display: none;" name="" id="" cols="30"

markdown编辑器的下载和使用

在这里插入图片描述在这里插入图片描述
记得选排名前几的

在这里插入图片描述
在这里插入图片描述


<section id="global">
    <div style=" min-height: 700px;" class="container-fluid cm-container-white">
        <div id="test-editormd">
            <textarea style="display: none;" name="" id="" cols="30" rows="10"></textarea>
        </div>
        <script src="md/js/editormd.min.js"></script>
        <script>
            var testEditor;

            $(function () {
                testEditor = editormd("test-editormd", {
                    width: "90%",
                    height: 640,
                    syncScrolling: "single",
                    path: "md/lib/",
                    imageUpload: true,
                    imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
                    imageUploadURL: "/file",
                    //这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
                    saveHTMLToTextarea: true
                    // previewTheme : "dark"
                });
            });

        </script>


</div>
</section>

注意点

因为这个样式库必须是依赖 jQuery 的,所以要在 script 引入 md的 js之前,把 jQuery 脚本引入,不然就会报错

在这里插入图片描述

本文地址:https://blog.csdn.net/qq_43923045/article/details/107877535

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网