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
2828$ delete_url = Common::relativeUrlToAbsolute ('/document/delete?id= ' . rawurlencode ($ object_id ));
2929$ edit_visible = ($ logged_in && ($ logged_in ->getOptionsBitmask () & User::OPTION_ACL_DOCUMENT_MODIFY ));
3030$ delete_visible = ($ logged_in && ($ logged_in ->getOptionsBitmask () & User::OPTION_ACL_DOCUMENT_DELETE ));
31+ require_once ('./MarkdownBootstrapFix.inc.php ' );
3132require ('./header.inc.phtml ' ); ?>
3233<div class="container mb-3">
3334<? if ($ object ) { ?>
@@ -36,11 +37,11 @@ require('./header.inc.phtml'); ?>
3637<? if ($ delete_visible ) { ?>
3738 <span class="float-right ml-1"><a class="btn btn-sm btn-danger" href="<?= $ delete_url?> " title="Delete">❌</a></span>
3839<? } 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>
4041<? } ?>
4142
4243 <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 ) )?>
4445
4546 <div class="card"><div class="card-body">
4647 <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