From 474873cc62b628f88f8f54f644ebf65010204eb8 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Mon, 8 Jun 2020 05:19:22 -0700 Subject: [PATCH] sigh --- code/game/say.dm | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/code/game/say.dm b/code/game/say.dm index d0d031ee0d..4a361b2461 100644 --- a/code/game/say.dm +++ b/code/game/say.dm @@ -97,20 +97,14 @@ GLOBAL_LIST_INIT(freqtospan, list( // Citadel edit [spanned ? ", \"[spanned]\"" : ""]" /atom/movable/proc/say_emphasis(input) - input = encode_html_emphasis(input, "|", "i") - input = encode_html_emphasis(input, "_", "u") - input = encode_html_emphasis(input, "+", "b") + var/static/regex/italics = regex("|(\\b.*?\\b)|", "g") + input = replacetext_char(input, italics, "$1") + var/static/regex/bold = regex("+(\\b.*?\\b)+", "g") + input = replacetext_char(input, bold, "$1") + var/static/regex/underline = regex("_(\\B.*?\\B)_", "g") + input = replacetext_char(input, underline, "$1") return input -/** - * Replaces a character inside message with html tags. Note that html var must not include brackets. - * Will not create an open html tag if it would not have a closing one. - */ -/atom/movable/proc/encode_html_emphasis(input, char, html) - var/regex/search = regex("([REGEX_QUOTE(char)])(\\b.*\\b)([REGEX_QUOTE(char)])", "g") - return search.Replace_char(input, "<[html]>$2") - - /// Quirky citadel proc for our custom sayverbs to strip the verb out. Snowflakey as hell, say rewrite 3.0 when? /atom/movable/proc/quoteless_say_quote(input, list/spans = list(speech_span), message_mode) var/pos = findtext(input, "*")