我正在使用WMD编辑器,我想添加wmd_options = {"output": "Markdown"};
我在标签前有下面这行。
<script type="text/javascript" src="../wmd/wmd.js"></script>我想知道如何添加这一行。
wmd_options = {"output": "Markdown"}; 我不是很擅长使用javascript,请帮助我使用这个。
谢谢
发布于 2011-01-29 03:51:31
<script type="text/javascript">
wmd_options = {"output": "Markdown"};
</script>
<script type="text/javascript" src="../wmd/wmd.js"></script>Javascript按照代码包含在页面上的顺序(从上到下)执行代码。因此,在执行wmd.js文件中的代码之前,需要先设置wmd_options。
发布于 2011-07-06 00:06:46
打开wmd.js。
查找此部分:
// -------------------------------------------------------------------
// YOUR CHANGES GO HERE
//
// I've tried to localize the things you are likely to change to
// this area.
// -------------------------------------------------------------------
// The text that appears on the upper part of the dialog box when
// entering links.
var imageDialogText = "<p style='margin-top: 0px'><b>Enter the image URL.</b></p><p>You can also add a title, which will be displayed as a tool tip.</p><p>Example:<br />http://wmd-editor.com/images/cloud1.jpg \"Optional title\"</p>";
var linkDialogText = "<p style='margin-top: 0px'><b>Enter the web address.</b></p><p>You can also add a title, which will be displayed as a tool tip.</p><p>Example:<br />http://wmd-editor.com/ \"Optional title\"</p>";
// The default text that appears in the dialog input box when entering
// links.
var imageDefaultText = "http://";
var linkDefaultText = "http://";
// The location of your button images relative to the base directory.
var imageDirectory = "images/";
// Some intervals in ms. These can be adjusted to reduce the control's load.
var previewPollInterval = 500;
var pastePollInterval = 100;
// The link and title for the help button
var helpLink = "http://wmd-editor.com/";
var helpHoverTitle = "WMD website";
var helpTarget = "_blank";
var wmd_options = {"output": "Markdown"}; //ADD IT HERE
// -------------------------------------------------------------------
// END OF YOUR CHANGES
// -------------------------------------------------------------------这会将您的所有输出作为Markdown文本发送到数据库。
如果您想要将HTML转换为Markdown文本进行编辑,因为您要将输入存储在HTML form中,那么您将需要这样的内容:http://milianw.de/projects/markdownify/
所以当你的用户点击他们的“编辑”按钮时。您可以像往常一样运行查询,但是可以通过Markdownify运行显示文本。
https://stackoverflow.com/questions/4832394
复制相似问题