Merge pull request #13847 from silicons/regex
fixes not being able to emphasize +s+ingle letters in chat
This commit is contained in:
@@ -98,11 +98,11 @@ GLOBAL_LIST_INIT(freqtospan, list(
|
||||
|
||||
/// Converts specific characters, like +, |, and _ to formatted output.
|
||||
/atom/movable/proc/say_emphasis(input)
|
||||
var/static/regex/italics = regex(@"\|(\S[\w\W]*?\S)\|", "g")
|
||||
var/static/regex/italics = regex(@"\|((?=\S)[\w\W]*?(?<=\S))\|", "g")
|
||||
input = italics.Replace_char(input, "<i>$1</i>")
|
||||
var/static/regex/bold = regex(@"\+(\S[\w\W]*?\S)\+", "g")
|
||||
var/static/regex/bold = regex(@"\+((?=\S)[\w\W]*?(?<=\S))\+", "g")
|
||||
input = bold.Replace_char(input, "<b>$1</b>")
|
||||
var/static/regex/underline = regex(@"_(\S[\w\W]*?\S)_", "g")
|
||||
var/static/regex/underline = regex(@"_((?=\S)[\w\W]*?(?<=\S))_", "g")
|
||||
input = underline.Replace_char(input, "<u>$1</u>")
|
||||
return input
|
||||
|
||||
|
||||
Reference in New Issue
Block a user