opps, was somehow missed to cherry-pick/merge ?

+ converted multiple single-line comments into one multi-line comment

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2017-04-08 19:36:38 +02:00
parent 61cfa9e42d
commit d94e878714
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78

View file

@ -198,10 +198,11 @@ function tryoembed($match) {
return $html; return $html;
} }
// [noparse][i]italic[/i][/noparse] turns into /*
// [noparse][ i ]italic[ /i ][/noparse], * [noparse][i]italic[/i][/noparse] turns into
// to hide them from parser. * [noparse][ i ]italic[ /i ][/noparse],
* to hide them from parser.
*/
function bb_spacefy($st) { function bb_spacefy($st) {
$whole_match = $st[0]; $whole_match = $st[0];
$captured = $st[1]; $captured = $st[1];
@ -210,10 +211,11 @@ function bb_spacefy($st) {
return $new_str; return $new_str;
} }
// The previously spacefied [noparse][ i ]italic[ /i ][/noparse], /*
// now turns back and the [noparse] tags are trimed * The previously spacefied [noparse][ i ]italic[ /i ][/noparse],
// returning [i]italic[/i] * now turns back and the [noparse] tags are trimed
* returning [i]italic[/i]
*/
function bb_unspacefy_and_trim($st) { function bb_unspacefy_and_trim($st) {
$whole_match = $st[0]; $whole_match = $st[0];
$captured = $st[1]; $captured = $st[1];
@ -344,14 +346,16 @@ function bb_extract_images($body) {
$new_body = $new_body . substr($orig_body, 0, $img_start) . '[$#saved_image' . $cnt . '#$]'; $new_body = $new_body . substr($orig_body, 0, $img_start) . '[$#saved_image' . $cnt . '#$]';
$cnt++; $cnt++;
} } else {
else
$new_body = $new_body . substr($orig_body, 0, $img_end + strlen('[/img]')); $new_body = $new_body . substr($orig_body, 0, $img_end + strlen('[/img]'));
}
$orig_body = substr($orig_body, $img_end + strlen('[/img]')); $orig_body = substr($orig_body, $img_end + strlen('[/img]'));
if ($orig_body === false) // in case the body ends on a closing image tag if ($orig_body === false) {
// in case the body ends on a closing image tag
$orig_body = ''; $orig_body = '';
}
$img_start = strpos($orig_body, '[img'); $img_start = strpos($orig_body, '[img');
$img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false); $img_st_close = ($img_start !== false ? strpos(substr($orig_body, $img_start), ']') : false);