File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
src/main/xar-resources/resources/scripts Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 11$ ( document ) . on ( "ready" , function ( ) {
2+ const markedOptions = { "gfm" : true }
23 const loginDialog = $ ( "#loginDialog" ) ;
34 let timeout = 0 ;
45
@@ -91,8 +92,24 @@ $(document).on("ready", function() {
9192
9293 // replace markdown element content with rendered HTML
9394 const mdContentElement = document . querySelector ( ".markdown" )
95+
9496 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 )
96113 mdContentElement . innerHTML = markdown
97114 }
98115} ) ;
You can’t perform that action at this time.
0 commit comments