aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-09-07 07:32:49 +0000
committerMario <mario@mariovavti.com>2021-09-07 07:33:36 +0000
commit60843605889fa9d590ce6c4adc0f3f03f23a55fe (patch)
treec9428bda822d8f57122e3e9c8d1432e4f7ea96a5 /include
parent0f54b26e9d458c0c12cd3cbdb609e439eb9e3812 (diff)
downloadvolse-hubzilla-60843605889fa9d590ce6c4adc0f3f03f23a55fe.tar.gz
volse-hubzilla-60843605889fa9d590ce6c4adc0f3f03f23a55fe.tar.bz2
volse-hubzilla-60843605889fa9d590ce6c4adc0f3f03f23a55fe.zip
deprecate the custom highlight [hl] bbcode in favor of [mark] which is a html5 standard
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 25615e385..42790aaca 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -1351,12 +1351,18 @@ function bbcode($Text, $options = []) {
if (strpos($Text,'[/color]') !== false) {
$Text = preg_replace("(\[color=(.*?)\](.*?)\[\/color\])ism", "<span style=\"color: $1;\">$2</span>", $Text);
}
- // Check for colored text
+
+ // @DEPRECATED: Check for colored text (deprecated in favor of mark which is a html5 standard)
if (strpos($Text,'[/hl]') !== false) {
- $Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "<span class=\"default-highlight\">$1</span>", $Text);
+ $Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "<span class=\"default-highlight\">$1</span>", $Text);
$Text = preg_replace("(\[hl=(.*?)\](.*?)\[\/hl\])ism", "<span style=\"background-color: $1;\">$2</span>", $Text);
}
+ if (strpos($Text,'[/mark]') !== false) {
+ $Text = preg_replace("(\[mark\](.*?)\[\/mark\])ism", "<mark class=\"mark\">$1</mark>", $Text);
+ $Text = preg_replace("(\[mark=(.*?)\](.*?)\[\/mark\])ism", "<mark style=\"background-color: $1;\">$2</mark>", $Text);
+ }
+
// Check for sized text
// [size=50] --> font-size: 50px (with the unit).
if (strpos($Text,'[/size]') !== false) {