
support code highlighte
@b476046cb74293a21bd10ae6f920944c7aa71376
--- app/assets/stylesheets/less/_markdown.less
+++ app/assets/stylesheets/less/_markdown.less
... | ... | @@ -81,11 +81,11 @@ |
81 | 81 |
} |
82 | 82 |
|
83 | 83 |
pre { |
84 |
+ background-color:#f8f8f8; |
|
84 | 85 |
code { |
85 | 86 |
marign : 0; |
86 | 87 |
padding: 0; |
87 | 88 |
border : none; |
88 |
- background-color:#f5f5f5; |
|
89 | 89 |
} |
90 | 90 |
} |
91 | 91 |
|
--- app/views/markdown.scala.html
+++ app/views/markdown.scala.html
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 |
|
3 | 3 |
@import utils.TemplateHelper._ |
4 | 4 |
|
5 |
-<link rel="stylesheet" type="text/css" href="@getCSSLink("hljsstyles/googlecode")" /> |
|
5 |
+<link rel="stylesheet" type="text/css" href="@getCSSLink("hljsstyles/default")" /> |
|
6 | 6 |
<script type="text/javascript" src="@getJSLink("lib/showdown")"></script> |
7 | 7 |
<script type="text/javascript" src="@getJSLink("lib/hljs/hljs")"></script> |
8 | 8 |
<script type="text/javascript" src="@getJSLink("lib/hljs/languages/allinone")"></script> |
--- public/javascripts/common/yobi.Markdown.js
+++ public/javascripts/common/yobi.Markdown.js
... | ... | @@ -64,10 +64,7 @@ |
64 | 64 |
smartLists: true, |
65 | 65 |
langPrefix: '', |
66 | 66 |
highlight: function(code, lang) { |
67 |
- if (lang === 'js') { |
|
68 |
- return highlighter.javascript(code); |
|
69 |
- } |
|
70 |
- return code; |
|
67 |
+ return hljs(code,lang).value; |
|
71 | 68 |
} |
72 | 69 |
}; |
73 | 70 |
|
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?