Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions BBCodePlus/BBCodePlus.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,9 @@ function init() {
* @return void
*/
function content_begin() {
if ( ON == $this->t_MantisCoreFormatting_process_markdown ) {
# display a warning if markdown processing is on.
$output = '<div class="alert alert-warning" id="check-notice-warnings">'.
plugin_lang_get( 'title' ) . ': '. plugin_lang_get( 'markdown_warning' ) . '</div>';
} else {
$output = '';
}
# BBCodePlus and MantisCoreFormatting Markdown can coexist: BBCode [tag] syntax and
# Markdown **syntax** are orthogonal and do not interfere with each other.
$output = '';
# add image picker modal.
$output .= '<div id="bbcodeplus-image-picker" class="bbcodeplus modal">';
$output .= '<div class="bbcodeplus modal-content widget-box widget-color-blue2">';
Expand Down Expand Up @@ -308,7 +304,9 @@ function string_process_bbcode( $p_string, $p_multiline = TRUE ) {
$p_string = preg_replace( '/<a href="([^"]*)" title="([^"]*)">([^"]*)<\/a>/is', '[url=$1]$3[/url]', $p_string);
$p_string = preg_replace( '/<a href="([^"]*)" title="([^"]*)" class="resolved">([^"]*)<\/a>/is', '[url=$1 resolved]$3[/url]', $p_string);
# strip all the auto generated URLs by MantisCoreFormatting plugin to avoid mangling.
if ( ON == $this->t_MantisCoreFormatting_process_urls ) {
# when markdown is active we must NOT strip hrefs, because MantisCoreFormatting renders
# markdown links ([text](url)) to <a> tags that we want to preserve, not destroy.
if ( ON == $this->t_MantisCoreFormatting_process_urls && OFF == $this->t_MantisCoreFormatting_process_markdown ) {
$p_string = string_strip_hrefs( $p_string );
}

Expand Down