diff --git a/code/game/say.dm b/code/game/say.dm index 4a361b2461..3cce5bcfc1 100644 --- a/code/game/say.dm +++ b/code/game/say.dm @@ -97,11 +97,11 @@ GLOBAL_LIST_INIT(freqtospan, list( // Citadel edit [spanned ? ", \"[spanned]\"" : ""]" /atom/movable/proc/say_emphasis(input) - var/static/regex/italics = regex("|(\\b.*?\\b)|", "g") + var/static/regex/italics = regex("\\|(?=\\S)(.*?)(?=\\S)\\|", "g") input = replacetext_char(input, italics, "$1") - var/static/regex/bold = regex("+(\\b.*?\\b)+", "g") + var/static/regex/bold = regex("\+(?=\S)(.*?)(?=\S)\+", "g") input = replacetext_char(input, bold, "$1") - var/static/regex/underline = regex("_(\\B.*?\\B)_", "g") + var/static/regex/underline = regex("_+(?=\S)(.*?)(?=\S)\_", "g") input = replacetext_char(input, underline, "$1") return input