Allows admin announcements to have newlines

This commit is contained in:
Tastyfish
2016-02-29 21:26:15 -05:00
parent 7e8a2ff237
commit eea6f30870
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -323,7 +323,7 @@ proc/checkhtml(var/t)
//This proc strips html properly, but it's not lazy like the other procs.
//This means that it doesn't just remove < and > and call it a day.
//Also limit the size of the input, if specified.
/proc/strip_html_properly(var/input, var/max_length = MAX_MESSAGE_LEN)
/proc/strip_html_properly(var/input, var/max_length = MAX_MESSAGE_LEN, allow_lines = 0)
if(!input)
return
var/opentag = 1 //These store the position of < and > respectively.
@@ -345,10 +345,10 @@ proc/checkhtml(var/t)
break
if(max_length)
input = copytext(input,1,max_length)
return sanitize(input)
return sanitize(input, allow_lines ? list("\t" = " ") : list("\n" = " ", "\t" = " "))
/proc/trim_strip_html_properly(var/input, var/max_length = MAX_MESSAGE_LEN)
return trim(strip_html_properly(input, max_length))
/proc/trim_strip_html_properly(var/input, var/max_length = MAX_MESSAGE_LEN, allow_lines = 0)
return trim(strip_html_properly(input, max_length, allow_lines))
//Used in preferences' SetFlavorText and human's set_flavor verb
//Previews a string of len or less length
+1 -1
View File
@@ -51,7 +51,7 @@
var/tmp/message_sound = new_sound ? sound(new_sound) : sound
if(!msg_sanitized)
message = trim_strip_html_properly(message)
message = trim_strip_html_properly(message, allow_lines = 1)
message_title = html_encode(message_title)
Message(message, message_title, from)