You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Packages/Sources/ParsingClient/Parsers/BBCodeParser.swift
+5-5
Original file line number
Diff line number
Diff line change
@@ -19,12 +19,12 @@ public final class BBCodeParser {
19
19
text = text.replacingOccurrences(of:"\\[i\\](.*?)\\[\\/i\\]", with:"<i>$1</i>", options:.regularExpression) // Italic
20
20
text = text.replacingOccurrences(of:"\\[s\\](.*?)\\[\\/s\\]", with:"<s>$1</s>", options:.regularExpression) // Strikethrough
21
21
text = text.replacingOccurrences(of:"\\[u\\](.*?)\\[\\/u\\]", with:"<u>$1</u>", options:.regularExpression) // Underline
22
-
text = text.replacingOccurrences(of:"\\[color=(.*?)\\](.*?)\\[\\/color\\]", with:"<font color=\"$1\">$2</font>", options:.regularExpression) // Text color
23
-
text = text.replacingOccurrences(of:"\\[size=(.*?)\\](.*?)\\[\\/size\\]", with:"<span style=\"font-size:$1\">$2</span>", options:.regularExpression) // Text size
24
-
text = text.replacingOccurrences(of:"\\[background=(.*?)\\](.*?)\\[\\/background\\]", with:"<span style=\"background-color:$1\">$2</span>", options:.regularExpression) // Text background
25
-
text = text.replacingOccurrences(of:"\\[font=\"(.*?)\"\\](.*?)\\[\\/font\\]", with:"<span style=\"font-family:$1\">$2</span>", options:.regularExpression) // Text font
22
+
text = text.replacingOccurrences(of:"\\[color=\"?(.*?)\"?\\](.*?)\\[\\/color\\]", with:"<font color=\"$1\">$2</font>", options:.regularExpression) // Text color
23
+
text = text.replacingOccurrences(of:"\\[size=\"?(.*?)\"?\\](.*?)\\[\\/size\\]", with:"<span style=\"font-size:$1\">$2</span>", options:.regularExpression) // Text size
24
+
text = text.replacingOccurrences(of:"\\[background=\"?(.*?)\"?\\](.*?)\\[\\/background\\]", with:"<span style=\"background-color:$1\">$2</span>", options:.regularExpression) // Text background
25
+
text = text.replacingOccurrences(of:"\\[font=\"?(.*?)\"?\\](.*?)\\[\\/font\\]", with:"<span style=\"font-family:$1\">$2</span>", options:.regularExpression) // Text font
26
26
text = text.replacingOccurrences(of:"\\[url\\](.*?)\\[\\/url\\]", with:"<a href=\"$1\">$1</a>", options:.regularExpression) // URL links without text
27
-
text = text.replacingOccurrences(of:"\\[url=\"(.*?)\"\\](.*?)\\[\\/url\\]", with:"<a href=\"$1\">$2</a>", options:.regularExpression) // URL links with text
27
+
text = text.replacingOccurrences(of:"\\[url=\"?(.*?)\"?\\](.*?)\\[\\/url\\]", with:"<a href=\"$1\">$2</a>", options:.regularExpression) // URL links with text
0 commit comments