File tree 1 file changed +18
-1
lines changed
src/main/xar-resources/resources/scripts
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
$ ( document ) . on ( "ready" , function ( ) {
2
+ const markedOptions = { "gfm" : true }
2
3
const loginDialog = $ ( "#loginDialog" ) ;
3
4
let timeout = 0 ;
4
5
@@ -91,8 +92,24 @@ $(document).on("ready", function() {
91
92
92
93
// replace markdown element content with rendered HTML
93
94
const mdContentElement = document . querySelector ( ".markdown" )
95
+
94
96
if ( mdContentElement ) {
95
- const markdown = marked ( mdContentElement . textContent )
97
+ const renderer = {
98
+ table ( header , body ) {
99
+ if ( body ) body = `<tbody>${ body } </tbody>`
100
+ return `<table class="table table-bordered">
101
+ <thead>
102
+ ${ header }
103
+ </thead>
104
+ ${ body }
105
+ </table>
106
+ ` ;
107
+ }
108
+ } ;
109
+
110
+ marked . use ( { renderer } ) ;
111
+
112
+ const markdown = marked ( mdContentElement . textContent , markedOptions )
96
113
mdContentElement . innerHTML = markdown
97
114
}
98
115
} ) ;
You can’t perform that action at this time.
0 commit comments