Merge pull request #13751 from Citadel-Station-13/silicons-patch-13

standardizes text formatting to rp server's |one character| instead of ||two|| because why did i even do the latter
This commit is contained in:
DeltaFire
2020-12-14 05:50:51 +01:00
committed by GitHub
+7 -9
View File
@@ -96,18 +96,16 @@ GLOBAL_LIST_INIT(freqtospan, list(
return "[say_mod(input, message_mode)][spanned ? ", \"[spanned]\"" : ""]"
// Citadel edit [spanned ? ", \"[spanned]\"" : ""]"
#define ENCODE_HTML_EPHASIS(input, char, html, varname) \
var/static/regex/##varname = regex("[char]{2}(.+?)[char]{2}", "g");\
input = varname.Replace_char(input, "<[html]>$1</[html]>")
/// Converts specific characters, like +, |, and _ to formatted output.
/atom/movable/proc/say_emphasis(input)
ENCODE_HTML_EPHASIS(input, "\\|", "i", italics)
ENCODE_HTML_EPHASIS(input, "\\+", "b", bold)
ENCODE_HTML_EPHASIS(input, "_", "u", underline)
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")
input = bold.Replace_char(input, "<b>$1</b>")
var/static/regex/underline = regex(@"_(\S[\w\W]*?\S)_", "g")
input = underline.Replace_char(input, "<u>$1</u>")
return input
#undef ENCODE_HTML_EPHASIS
/// 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)
if((input[1] == "!") && (length_char(input) > 1))