insanehong 2013-09-04
support code highlighte
@b476046cb74293a21bd10ae6f920944c7aa71376
app/assets/stylesheets/less/_markdown.less
--- app/assets/stylesheets/less/_markdown.less
+++ app/assets/stylesheets/less/_markdown.less
@@ -81,11 +81,11 @@
 	}
 
 	pre {
+		background-color:#f8f8f8;
 		code {
 			marign : 0;
 			padding: 0;
 			border : none;
-			background-color:#f5f5f5;
 		}
 	}
 
app/views/markdown.scala.html
--- app/views/markdown.scala.html
+++ app/views/markdown.scala.html
@@ -2,7 +2,7 @@
 
 @import utils.TemplateHelper._
 
-<link rel="stylesheet" type="text/css" href="@getCSSLink("hljsstyles/googlecode")" />
+<link rel="stylesheet" type="text/css" href="@getCSSLink("hljsstyles/default")" />
 <script type="text/javascript" src="@getJSLink("lib/showdown")"></script>
 <script type="text/javascript" src="@getJSLink("lib/hljs/hljs")"></script>
 <script type="text/javascript" src="@getJSLink("lib/hljs/languages/allinone")"></script>
public/javascripts/common/yobi.Markdown.js
--- public/javascripts/common/yobi.Markdown.js
+++ public/javascripts/common/yobi.Markdown.js
@@ -64,10 +64,7 @@
           smartLists: true,
           langPrefix: '',
           highlight: function(code, lang) {
-            if (lang === 'js') {
-              return highlighter.javascript(code);
-            }
-            return code;
+            return hljs(code,lang).value;
           }
         };
         
Add a comment
List