This commit is contained in:
kevinz000
2020-06-08 05:19:22 -07:00
parent e47ed9356f
commit 474873cc62
+6 -12
View File
@@ -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, "<i>$1</i>")
var/static/regex/bold = regex("+(\\b.*?\\b)+", "g")
input = replacetext_char(input, bold, "<b>$1</b>")
var/static/regex/underline = regex("_(\\B.*?\\B)_", "g")
input = replacetext_char(input, underline, "<u>$1</u>")
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</[html]>")
/// 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, "*")