diff options
author | friendica <info@friendica.com> | 2014-06-19 20:38:38 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-06-19 20:38:38 -0700 |
commit | 525daa7475f219f51258dcdb5ed634e7112020de (patch) | |
tree | 2a0a2379a0fa86432f73c3a04766c1d4c71af3a5 /include/bbcode.php | |
parent | 00904d49946c4a411225555cb99b5700f6ab51e4 (diff) | |
download | volse-hubzilla-525daa7475f219f51258dcdb5ed634e7112020de.tar.gz volse-hubzilla-525daa7475f219f51258dcdb5ed634e7112020de.tar.bz2 volse-hubzilla-525daa7475f219f51258dcdb5ed634e7112020de.zip |
fix space around brackets changing.
Diffstat (limited to 'include/bbcode.php')
-rw-r--r-- | include/bbcode.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index 674b5f45a..60463fc00 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -344,9 +344,15 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { $a = get_app(); - // Move all spaces out of the tags - $Text = preg_replace("/\[(\w*)\](\s*)/ism", '$2[$1]', $Text); - $Text = preg_replace("/(\s*)\[\/(\w*)\]/ism", '[/$2]$1', $Text); + // Move all spaces out of the tags + // ....Uhm why? + // This is basically doing a trim() on the stuff in between tags, but it messes up + // carefully crafted bbcode and especially other pre-formatted code. + // Commenting out until we come up with a use case where it's needed. Then let's try and + // special case rather than a heavy-handed approach like this. + +// $Text = preg_replace("/\[(\w*)\](\s*)/ism", '$2[$1]', $Text); +// $Text = preg_replace("/(\s*)\[\/(\w*)\]/ism", '[/$2]$1', $Text); // Hide all [noparse] contained bbtags by spacefying them if (strpos($Text,'[noparse]') !== false) { |