如何添加WMD编辑器 - wmd_options = {“output”: “Markdown”};
我正在使用 WMD 编辑器,我想添加 wmd_options = {"output": "Markdown"};
我在标记之前有以下行。
<script type="text/javascript" src="../wmd/wmd.js"></script>
我想了解如何添加这一行。
wmd_options = {"output": "Markdown"};
我不太擅长使用 javascript 请帮助我使用它。
谢谢
I am using WMD Editor and I want to add wmd_options = {"output": "Markdown"};
I have following line before tag.
<script type="text/javascript" src="../wmd/wmd.js"></script>
I want to understand how can i add this line.
wmd_options = {"output": "Markdown"};
I am not very good at using javascript please help me to use this.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Javascript 按照代码包含在页面上的顺序执行代码(从上到下)。因此,在执行wmd.js文件中的代码之前,您需要先设置wmd_options。
Javascript executes code in the order it is included on the page (from top to bottom). So you need to set the wmd_options first before the code in the wmd.js file is executed.
打开 wmd.js。
查找此部分:
这会将所有输出作为 Markdown 文本发送到数据库。
如果您想将 HTML 转换为 Markdown 文本进行编辑,因为您以 HTML 形式存储输入,那么您将需要如下内容:
http://milianw.de/projects/markdownify/
因此,当您的用户点击“编辑”时按钮。您可以像平常一样运行查询,但通过 Markdownify 运行显示文本。
Open up wmd.js.
Look for this section:
This will send all of your output to the database as Markdown text.
If you want to convert HTML to Markdown text for editing, because you are storing your input in HTML form, then you will need something like this:
http://milianw.de/projects/markdownify/
So when your user clicks on their 'edit' button. You run the query as you normally would, but you run the display text through Markdownify.