File tree 3 files changed +14
-0
lines changed
3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 35
35
white-space : pre;
36
36
overflow : auto;
37
37
}
38
+ .file-content .markdown {
39
+ font-family : Arial;
40
+ white-space : normal;
41
+ }
38
42
39
43
.edit {
40
44
display : none;
Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ <h2 id="repo_name"></h2>
121
121
< script type ="text/javascript " src ="../../js/issues.js "> </ script >
122
122
< script type ="text/javascript " src ="../js/path_common.js "> </ script >
123
123
< script type ="text/javascript " src ="../js/common.js "> </ script >
124
+ < script type ="text/javascript " src ="../../marked/marked.js "> </ script >
124
125
< script type ="text/javascript " src ="../../hljs/highlight.min.js "> </ script >
125
126
< script type ="text/javascript " src ="js/main.js "> </ script >
126
127
< script type ="text/javascript " src ="../../js/root.js "> </ script >
Original file line number Diff line number Diff line change @@ -57,6 +57,15 @@ repo.addMerger()
57
57
return repo . getFile ( head , path )
58
58
. then ( blob => {
59
59
let fileContent = document . getElementById ( "file_content" ) ;
60
+
61
+ // Maybe this is a markdown file?
62
+ if ( path . endsWith ( ".md" ) || path . endsWith ( ".markdown" ) ) {
63
+ fileContent . classList . add ( "markdown" ) ;
64
+ fileContent . innerHTML = repo . renderMarked ( repo . vcs . decodeUTF8 ( blob ) ) ;
65
+ return ;
66
+ }
67
+
68
+
60
69
fileContent . textContent = repo . vcs . decodeUTF8 ( blob ) ;
61
70
hljs . highlightBlock ( fileContent ) ;
62
71
You can’t perform that action at this time.
0 commit comments