File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ $edit_url = Common::relativeUrlToAbsolute('/document/edit?id=' . rawurlencode($o
28
28
$ delete_url = Common::relativeUrlToAbsolute ('/document/delete?id= ' . rawurlencode ($ object_id ));
29
29
$ edit_visible = ($ logged_in && ($ logged_in ->getOptionsBitmask () & User::OPTION_ACL_DOCUMENT_MODIFY ));
30
30
$ delete_visible = ($ logged_in && ($ logged_in ->getOptionsBitmask () & User::OPTION_ACL_DOCUMENT_DELETE ));
31
+ require_once ('./MarkdownBootstrapFix.inc.php ' );
31
32
require ('./header.inc.phtml ' ); ?>
32
33
<div class="container mb-3">
33
34
<? if ($ object ) { ?>
@@ -36,11 +37,11 @@ require('./header.inc.phtml'); ?>
36
37
<? if ($ delete_visible ) { ?>
37
38
<span class="float-right ml-1"><a class="btn btn-sm btn-danger" href="<?= $ delete_url?> " title="Delete">❌</a></span>
38
39
<? } if ($ edit_visible ) { ?>
39
- <span class="float-right ml-1"><a class="btn btn-sm btn-primary " href="<?= $ edit_url?> " title="Edit">📝</a></span>
40
+ <span class="float-right ml-1"><a class="btn btn-sm btn-secondary " href="<?= $ edit_url?> " title="Edit">📝</a></span>
40
41
<? } ?>
41
42
42
43
<h2><a href="<?= $ url?> "><?= filter_var ($ title , FILTER_SANITIZE_FULL_SPECIAL_CHARS )?> </a></h2>
43
- <?= $ object ->getContent (true )?>
44
+ <?= \ BNETDocs \ Templates \MarkdownBootstrapFix ( $ object ->getContent (true ) )?>
44
45
45
46
<div class="card"><div class="card-body">
46
47
<span class="float-right">
Original file line number Diff line number Diff line change
1
+ <?php /* vim: set colorcolumn=: */
2
+ namespace BNETDocs \Templates ;
3
+
4
+ /**
5
+ * Adds CSS classes to Markdown output
6
+ */
7
+ function MarkdownBootstrapFix (string $ v )
8
+ {
9
+ $ v = str_replace ('<table> ' , '<table class="table table-hover table-markdown table-striped"> ' , $ v );
10
+ $ v = str_replace ('<blockquote> ' , '<blockquote class="blockquote"> ' , $ v );
11
+ $ v = str_replace ('<img ' , '<img class="img-fluid" ' , $ v );
12
+
13
+ return $ v ;
14
+ }
You can’t perform that action at this time.
0 commit comments