Skip to content

Commit

Permalink
Merge pull request #37 from bkraul/develop-2.0.x
Browse files Browse the repository at this point in the history
Addressed regression introduced by ISS merge.
  • Loading branch information
bkraul authored Mar 15, 2019
2 parents 6dcb3fb + af21480 commit d39c08f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
22 changes: 11 additions & 11 deletions BBCodePlus/BBCodePlus.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function register() {
$this->name = plugin_lang_get( 'title' );
$this->description = plugin_lang_get( 'description' );
$this->page = 'config';
$this->version = '2.0.17';
$this->version = '2.0.18';

$this->requires['MantisCore'] = '2.0.0';
# this plugin can coexist with MantisCoreFormatting.
Expand Down Expand Up @@ -314,16 +314,16 @@ function string_process_bbcode( $p_string, $p_multiline = TRUE ) {

# code=lang
$p_string = preg_replace_callback('/\[code=(\w+)\](.+)\[\/code\]/imsU',
create_function('$m', '
function ($m) {
return "<pre><code class=\"language-" . strtolower($m[1]) . "\">" . $m[2] . "</code></pre>";
')
}
, $p_string);

# code=lang start=n
$p_string = preg_replace_callback('/\[code=(\w+)\ start=([0-9]+)\](.+)\[\/code\]/imsU',
create_function('$m', '
function ($m) {
return "<pre class=\"line-numbers\" data-start=\"" . $m[2] . "\"><code class=\"language-" . strtolower($m[1]) . "\">" . $m[3] . "</code></pre>";
')
}
, $p_string);

# process quotes.
Expand Down Expand Up @@ -436,16 +436,16 @@ function string_strip_bbcode( $p_string, $p_multiline = TRUE ) {

# code=lang
$p_string = preg_replace_callback('/\[code=(\w+)\](.+)\[\/code\]/imsU',
create_function('$m', '
function ($m) {
return $m[2];
')
}
, $p_string);

# code=lang start=n
$p_string = preg_replace_callback('/\[code=(\w+)\ start=([0-9]+)\](.+)\[\/code\]/imsU',
create_function('$m', '
function ($m) {
return $m[3];
')
}
, $p_string);

# process quotes.
Expand Down Expand Up @@ -482,9 +482,9 @@ function restore_pre_code_tags( $p_string, $p_multiline = true ) {
$tags = implode( '|', $tags );

$t_string = preg_replace_callback('/&lt;(' . $tags . ')(.*?)&gt;/ui',
create_function('$m', '
function($m) {
return "<" . $m[1] . str_replace("&quot;", "\"", $m[2]) . ">";
')
}
, $t_string);

$t_string = preg_replace( '/&lt;\/(' . $tags . ')\s*&gt;/ui', '</\\1>', $t_string );
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
BBCodePlus
=============
BBCode plugin for Mantis BugTracker 2.0
BBCode plugin for Mantis BugTracker 2.x

* See [1.2.x branch](https://github.com/mantisbt-plugins/BBCodePlus/tree/master-1.2.x) for the Mantis 1.2 version.
* See [BBCodePlus](https://github.com/mantisbt-plugins/BBCodePlus) for the Mantis 1.3 version.
* See branch [master-1.2.x](https://github.com/mantisbt-plugins/BBCodePlus/tree/master-1.2.x) for the Mantis 1.2 version.
* See [master](https://github.com/mantisbt-plugins/BBCodePlus) for the Mantis 1.3 version.

Incorporates the following configurable features:

Expand Down Expand Up @@ -53,4 +53,8 @@ Supported BBCode Tags
[code start=3][/code] - Code block with line numbers starting at number.
[quote][/quote] - Quote by *someone* (no name).
[quote=name][/quote] - Quote by *name*.
```
```
## Contributing to BBCodePlus

If you would like to contribute to BBCode plus, please [read this first](https://github.com/mantisbt-plugins/BBCodePlus/wiki/Contributing-to-BBCodePlus).

0 comments on commit d39c08f

Please sign in to comment.