diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/bbcode.php | 2 | ||||
-rw-r--r-- | include/html2bbcode.php | 8 | ||||
-rw-r--r-- | include/html2plain.php | 4 |
3 files changed, 10 insertions, 4 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index 844717572..5b97c1d9b 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1408,7 +1408,7 @@ function bbcode($text, $options = []) { } // Check for strike-through text if (strpos($text,'[s]') !== false) { - $text = preg_replace("(\[s\](.*?)\[\/s\])ism", '<span style="text-decoration: line-through;">$1</span>', $text); + $text = preg_replace("(\[s\](.*?)\[\/s\])ism", '<del>$1</del>', $text); } // Check for over-line text if (strpos($text,'[o]') !== false) { diff --git a/include/html2bbcode.php b/include/html2bbcode.php index e1c0572f5..db8f3a8e0 100644 --- a/include/html2bbcode.php +++ b/include/html2bbcode.php @@ -128,9 +128,9 @@ function html2bbcode($message) $message = preg_replace('/\<ul(.*?)\>/', '[list]', $message); $message = preg_replace('/\<ol(.*?)\>/', '[list=1]', $message); + $message = preg_replace('/\<li(.*?)\>/', '[*]', $message); $message = str_replace(['</ul>', '</ol>'], '[/list]', $message); - $message = str_replace(['<li><p>', '<li>'], '[*]', $message); - $message = str_replace(['</p></li>', '</li>'], '', $message); + $message = str_replace('</li>', '', $message); if(!$message) return; @@ -186,7 +186,11 @@ function html2bbcode($message) node2bbcode($doc, 'b', array(), '[b]', '[/b]'); node2bbcode($doc, 'i', array(), '[i]', '[/i]'); node2bbcode($doc, 'u', array(), '[u]', '[/u]'); + // The s tag is deprecated in HTML5 node2bbcode($doc, 's', array(), '[s]', '[/s]'); + node2bbcode($doc, 'del', [], '[s]', '[/s]'); + + node2bbcode($doc, 'mark', array(), '[mark]', '[/mark]'); node2bbcode($doc, 'span', array(), "", ""); diff --git a/include/html2plain.php b/include/html2plain.php index 5cb7ee35d..88dce577d 100644 --- a/include/html2plain.php +++ b/include/html2plain.php @@ -129,6 +129,8 @@ function html2plain($html, $wraplength = 75, $compact = false) if(!$message) return; + $message = preg_replace('/\<li(.*?)\>/', "\n*", $message); + $message = str_replace('</li>', '', $message); $doc = new DOMDocument(); $doc->preserveWhiteSpace = false; @@ -178,7 +180,7 @@ function html2plain($html, $wraplength = 75, $compact = false) //node2bbcode($doc, 'ul', array(), "\n[list]", "[/list]\n"); //node2bbcode($doc, 'ol', array(), "\n[list=1]", "[/list]\n"); - node2bbcode($doc, 'li', array(), "\n* ", "\n"); + //node2bbcode($doc, 'li', array(), "\n* ", "\n"); node2bbcode($doc, 'hr', array(), "\n".str_repeat("-", 70)."\n", ""); |