玛氪宕·梦魔(Markdown Memo),使用Markdown的云端备忘录,百度IFE的RIA启航班的不合格的作业,才……才没有什么阴谋呢!
源gitee链接https://gitee.com/arathi/MarkdownMemo?_from=gitee_search
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
120 lines
4.5 KiB
120 lines
4.5 KiB
<!DOCTYPE html>
|
|
<html lang="zh">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>HTML Preview(markdown to html) - Editor.md examples</title>
|
|
<link rel="stylesheet" href="css/style.css" />
|
|
<link rel="stylesheet" href="../css/editormd.preview.css" />
|
|
<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
|
|
<style>
|
|
.editormd-html-preview {
|
|
width: 90%;
|
|
margin: 0 auto;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="layout">
|
|
<header>
|
|
<h1>Markdown转HTML的显示处理</h1>
|
|
<p>即:非编辑情况下的HTML预览</p>
|
|
<p>HTML Preview(markdown to html)</p>
|
|
</header>
|
|
<div id="test-editormd-view">
|
|
<textarea style="display:none;" name="test-editormd-markdown-doc">###Hello world!</textarea>
|
|
</div>
|
|
<div id="test-editormd-view2">
|
|
<textarea id="append-test" style="display:none;">
|
|
|
|
###科学公式 TeX(KaTeX)
|
|
|
|
$$E=mc^2$$
|
|
|
|
行内的公式$$E=mc^2$$行内的公式,行内的$$E=mc^2$$公式。
|
|
|
|
$$\(\sqrt{3x-1}+(1+x)^2\)$$
|
|
|
|
$$\sin(\alpha)^{\theta}=\sum_{i=0}^{n}(x^i + \cos(f))$$
|
|
|
|
#####上标和下标
|
|
|
|
上标:X<sup>2</sup>
|
|
|
|
下标:O<sub>2</sub>
|
|
|
|
#####Style
|
|
|
|
<style>
|
|
body{background:red;}
|
|
</style>
|
|
|
|
<style type="text/style">
|
|
body{background:red;}
|
|
</style>
|
|
|
|
#####Script
|
|
|
|
<script>
|
|
alert("script");
|
|
</script>
|
|
|
|
<script type="text/javscript">
|
|
alert("script");
|
|
</script></textarea>
|
|
</div>
|
|
</div>
|
|
<!-- <script src="js/zepto.min.js"></script>
|
|
<script>
|
|
var jQuery = Zepto; // 为了避免修改flowChart.js和sequence-diagram.js的源码,所以使用Zepto.js时想支持flowChart/sequenceDiagram就得加上这一句
|
|
</script> -->
|
|
<script src="js/jquery.min.js"></script>
|
|
<script src="../lib/marked.min.js"></script>
|
|
<script src="../lib/prettify.min.js"></script>
|
|
|
|
<script src="../lib/raphael.min.js"></script>
|
|
<script src="../lib/underscore.min.js"></script>
|
|
<script src="../lib/sequence-diagram.min.js"></script>
|
|
<script src="../lib/flowchart.min.js"></script>
|
|
<script src="../lib/jquery.flowchart.min.js"></script>
|
|
|
|
<script src="../editormd.js"></script>
|
|
<script type="text/javascript">
|
|
var testEditormdView, testEditormdView2;
|
|
|
|
$(function() {
|
|
$.get("test.md", function(markdown) {
|
|
testEditormdView = editormd.markdownToHTML("test-editormd-view", {
|
|
markdown : markdown + "\r\n" + $("#append-test").val(),
|
|
//htmlDecode : true, // 开启HTML标签解析,为了安全性,默认不开启
|
|
htmlDecode : "style,script,iframe", // you can filter tags decode
|
|
//toc : false,
|
|
tocm : true, // Using [TOCM]
|
|
//gfm : false,
|
|
//tocDropdown : true,
|
|
emoji : true,
|
|
taskList : true,
|
|
tex : true, // 默认不解析
|
|
flowChart : true, // 默认不解析
|
|
sequenceDiagram : true, // 默认不解析
|
|
});
|
|
|
|
//console.log("返回一个jQuery实例 =>", testEditormdView);
|
|
|
|
// 获取Markdown源码
|
|
console.log(testEditormdView.getMarkdown());
|
|
|
|
//alert(testEditormdView.getMarkdown());
|
|
});
|
|
|
|
testEditormdView2 = editormd.markdownToHTML("test-editormd-view2", {
|
|
htmlDecode : "style,script,iframe", // you can filter tags decode
|
|
emoji : true,
|
|
taskList : true,
|
|
tex : true, // 默认不解析
|
|
flowChart : true, // 默认不解析
|
|
sequenceDiagram : true, // 默认不解析
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|