#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
调用markdown来解析得到html 调用markdown来解析得到html
--> -->
{{if $.post.IsMarkdown }} {{if $.post.IsMarkdown }}
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script> <script src="/public/libs/md2html/md2html.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> <script>
var content = $.trim($("#markdownContent textarea").val()); var content = $.trim($("#markdownContent textarea").val());
var converter = Markdown.getSanitizingConverter(); md2Html(content, $("#content"), function(html) {
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
var html = converter.makeHtml(content);
$("#content").html(html);
$("pre").addClass("prettyprint linenums"); $("pre").addClass("prettyprint linenums");
prettyPrint(); prettyPrint();
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
initNav(); initNav();
weixin(); weixin();
});
</script> </script>
<!-- 不是markdown --> <!-- 不是markdown -->
{{else}} {{else}}
<script> <script>

View File

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

View File

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

View File

@ -107,35 +107,17 @@ var commentNum = +"{{$.post.CommentNum}}";
<!-- <!--
markdown markdown
调用markdown来解析得到html 调用markdown来解析得到html
--> -->{{if $.post.IsMarkdown }}
<script src="/public/libs/md2html/md2html.js"></script>
{{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> <script>
var content = $.trim($("#markdownContent textarea").val()); var content = $.trim($("#markdownContent textarea").val());
var converter = Markdown.getSanitizingConverter(); md2Html(content, $("#content"), function(html) {
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
var html = converter.makeHtml(content);
$("#content").html(html);
$("pre").addClass("prettyprint linenums"); $("pre").addClass("prettyprint linenums");
prettyPrint(); prettyPrint();
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
initNav(); initNav();
weixin(); weixin();
});
</script> </script>
<!-- 不是markdown --> <!-- 不是markdown -->
{{else}} {{else}}
<script> <script>

View File

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

View File

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

View File

@ -108,34 +108,17 @@ var commentNum = +"{{$.post.CommentNum}}";
markdown markdown
调用markdown来解析得到html 调用markdown来解析得到html
--> -->
{{if $.post.IsMarkdown }} {{if $.post.IsMarkdown }}
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script> <script src="/public/libs/md2html/md2html.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> <script>
var content = $.trim($("#markdownContent textarea").val()); var content = $.trim($("#markdownContent textarea").val());
var converter = Markdown.getSanitizingConverter(); md2Html(content, $("#content"), function(html) {
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
var html = converter.makeHtml(content);
$("#content").html(html);
$("pre").addClass("prettyprint linenums"); $("pre").addClass("prettyprint linenums");
prettyPrint(); prettyPrint();
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
initNav(); initNav();
weixin(); weixin();
});
</script> </script>
<!-- 不是markdown --> <!-- 不是markdown -->
{{else}} {{else}}
<script> <script>

View File

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

View File

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