aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-05-07 08:52:05 +0000
committerMario <mario@mariovavti.com>2024-05-07 08:52:05 +0000
commitf74922db39df383d205fdcd0f25f6690af5b6c2f (patch)
tree4a14b26114b924ac50cfff825a082cef757ee14a
parent605aa37ad35387cbd84d1efd7bd744b5f1eb166c (diff)
downloadvolse-hubzilla-f74922db39df383d205fdcd0f25f6690af5b6c2f.tar.gz
volse-hubzilla-f74922db39df383d205fdcd0f25f6690af5b6c2f.tar.bz2
volse-hubzilla-f74922db39df383d205fdcd0f25f6690af5b6c2f.zip
add bbcode support for the HTML5 del tag
-rw-r--r--include/bbcode.php2
-rw-r--r--include/html2bbcode.php4
2 files changed, 5 insertions, 1 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 e0a9a630a..db8f3a8e0 100644
--- a/include/html2bbcode.php
+++ b/include/html2bbcode.php
@@ -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(), "", "");