#133 修改默认主题, 更新markdown解析器

This commit is contained in:
lealife
2015-05-07 00:02:54 +08:00
parent 1ec28d80c8
commit 1fd6610fa3
9 changed files with 35 additions and 83 deletions

View File

@ -108,34 +108,17 @@ var commentNum = +"{{$.post.CommentNum}}";
markdown
调用markdown来解析得到html
-->
{{if $.post.IsMarkdown }}
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
<!--mathjax-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
</script>
<script src="/public/mdeditor/editor/mathJax.js"></script>
<script src="/public/libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>
<script src="/public/libs/md2html/md2html.js"></script>
<script>
var content = $.trim($("#markdownContent textarea").val());
var converter = Markdown.getSanitizingConverter();
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
var html = converter.makeHtml(content);
$("#content").html(html);
$("pre").addClass("prettyprint linenums");
prettyPrint();
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
initNav();
weixin();
md2Html(content, $("#content"), function(html) {
$("pre").addClass("prettyprint linenums");
prettyPrint();
initNav();
weixin();
});
</script>
<!-- 不是markdown -->
{{else}}
<script>

View File

@ -530,3 +530,8 @@ table tr:nth-child(2n) {
border-collapse: collapse;
padding: 6px 13px;
}
.desc *, #content * {
word-wrap: break-word;
}

View File

@ -9,7 +9,6 @@
* Name
* Desc ,
* Version
* Author
* AuthorUrl
@ -19,7 +18,6 @@
*/
{
"Name": "Leanote default theme",
"Desc": "",
"Version": "1.0",
"Author": "leanote.com",
"AuthorUrl": "http://leanote.com",

View File

@ -107,35 +107,17 @@ var commentNum = +"{{$.post.CommentNum}}";
<!--
markdown
调用markdown来解析得到html
-->
{{if $.post.IsMarkdown }}
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
<!--mathjax-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
</script>
<script src="/public/mdeditor/editor/mathJax.js"></script>
<script src="/public/libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>
-->{{if $.post.IsMarkdown }}
<script src="/public/libs/md2html/md2html.js"></script>
<script>
var content = $.trim($("#markdownContent textarea").val());
var converter = Markdown.getSanitizingConverter();
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
var html = converter.makeHtml(content);
$("#content").html(html);
$("pre").addClass("prettyprint linenums");
prettyPrint();
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
initNav();
weixin();
md2Html(content, $("#content"), function(html) {
$("pre").addClass("prettyprint linenums");
prettyPrint();
initNav();
weixin();
});
</script>
<!-- 不是markdown -->
{{else}}
<script>

View File

@ -203,7 +203,6 @@ ul.dropdown-menu {
}
#footer {
padding-bottom: 10px;
width: 700px;
}
.navbar-brand {
display: none;
@ -541,4 +540,7 @@ table tr:nth-child(2n) {
border: 1px solid #ddd;
border-collapse: collapse;
padding: 6px 13px;
}
.desc *, #content * {
word-wrap: break-word;
}

View File

@ -9,17 +9,15 @@
* Name
* Desc ,
* Version
* Author
* AuthorUrl
* FriendLinks
* FriendLinks
*/
{
"Name": "Leanote elegant",
"Desc": "",
"Version": "1.0",
"Author": "leanote.com",
"AuthorUrl": "http://leanote.com",

View File

@ -108,34 +108,17 @@ var commentNum = +"{{$.post.CommentNum}}";
markdown
调用markdown来解析得到html
-->
{{if $.post.IsMarkdown }}
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
<!--mathjax-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
</script>
<script src="/public/mdeditor/editor/mathJax.js"></script>
<script src="/public/libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>
<script src="/public/libs/md2html/md2html.js"></script>
<script>
var content = $.trim($("#markdownContent textarea").val());
var converter = Markdown.getSanitizingConverter();
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
var html = converter.makeHtml(content);
$("#content").html(html);
$("pre").addClass("prettyprint linenums");
prettyPrint();
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
initNav();
weixin();
md2Html(content, $("#content"), function(html) {
$("pre").addClass("prettyprint linenums");
prettyPrint();
initNav();
weixin();
});
</script>
<!-- 不是markdown -->
{{else}}
<script>

View File

@ -580,3 +580,6 @@ table tr:nth-child(2n) {
border-collapse: collapse;
padding: 6px 13px;
}
.desc *, #content * {
word-wrap: break-word;
}

View File

@ -9,17 +9,15 @@
* Name
* Desc ,
* Version
* Author
* AuthorUrl
* FriendLinks
* FriendLinks
*/
{
"Name": "Leanote nav fixed",
"Desc": "",
"Version": "1.0",
"Author": "leanote.com",
"AuthorUrl": "http://leanote.com",