WMD - 如何获取生成的\Markdown HTML 代码
好吧,我得到了 WMD,但我无法学习如何获取生成的 HTML\Markdown 代码...我想将其发送到数据库...这就是我使用 PHP 的原因...
<script src='wmd.js'></script>
<form name="formname" method='POST'>
<textarea id="myTextarea" style="width: 500px; height: 200px;">
*This* example sets WMD's options programmatically.
</textarea>
<input type="submit" name="sub" value="submit">
</form>
<!--Preview Can Be Seen Here-->
<div class="wmd-preview" id="wmd"></div>
<?php
if( isset( $_POST['sub'] ) )
{
$generated_HTML = "How to get it here";
}
?>
现在有人可以告诉我吗如何获取生成的 HTML...
well i got WMD but i am unable to learn how to get the generated HTML\Markdown Code.... i want to send it to the DB... thats why i am using PHP....
<script src='wmd.js'></script>
<form name="formname" method='POST'>
<textarea id="myTextarea" style="width: 500px; height: 200px;">
*This* example sets WMD's options programmatically.
</textarea>
<input type="submit" name="sub" value="submit">
</form>
<!--Preview Can Be Seen Here-->
<div class="wmd-preview" id="wmd"></div>
<?php
if( isset( $_POST['sub'] ) )
{
$generated_HTML = "How to get it here";
}
?>
now can anyone please tell me how to get the generated HTML...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
WMD编辑器只是一个客户端文本编辑器,支持markdown格式文本的输入。要将 Markdown 转换为 HTML,您需要一个 Markdown 解析器。
快速谷歌告诉我至少有一个可用: http://michelf.com/projects/php-降价/
The WMD editor is just a client-side text editor that supports the input of markdown-formatted text. To convert markdown to HTML you'll need a markdown parser.
A quick google tells me there's at least one available: http://michelf.com/projects/php-markdown/
获取这些文件
wmd.js
& markdown.php并使用以下代码
get these files
wmd.js
& markdown.phpand use the follwing code