projects
/
friendica.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f828afd
)
Improve html2bbcode
author
Hypolite Petovan
<mrpetovan@gmail.com>
Sun, 14 Jan 2018 18:13:16 +0000
(13:13 -0500)
committer
Hypolite Petovan
<mrpetovan@gmail.com>
Mon, 15 Jan 2018 00:01:09 +0000
(19:01 -0500)
- trim code blocks
- Add <code> conversion to <code> (from Diaspora)
include/html2bbcode.php
patch
|
blob
|
history
diff --git
a/include/html2bbcode.php
b/include/html2bbcode.php
index 763351e802d44179075969b4876b8066c7c3b0f6..936bce338476fa26b265201bfd051a95b76e879e 100644
(file)
--- a/
include/html2bbcode.php
+++ b/
include/html2bbcode.php
@@
-95,7
+95,7
@@
function html2bbcode($message, $basepath = '')
if ($matches[1] != '') {
$prefix = '[code=' . $matches[1] . ']';
}
- $codeblocks[] = $prefix .
$matches[2]
. '[/code]';
+ $codeblocks[] = $prefix .
trim($matches[2])
. '[/code]';
return $return;
},
$message
@@
-247,6
+247,7
@@
function html2bbcode($message, $basepath = '')
node2bbcode($doc, 'iframe', array('src'=>'/(.+)/'), '[iframe]$1', '[/iframe]');
node2bbcode($doc, 'key', array(), '[code]', '[/code]');
+ node2bbcode($doc, 'code', array(), '[code]', '[/code]');
$message = $doc->saveHTML();