mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 11:13:16 +00:00
Alternative copytext, safe for html entities
This commit is contained in:
@@ -274,7 +274,11 @@ proc/TextPreview(var/string,var/len=40)
|
||||
else
|
||||
return string
|
||||
else
|
||||
return "[copytext(string, 1, 37)]..."
|
||||
return "[copytext_preserve_html(string, 1, 37)]..."
|
||||
|
||||
//alternative copytext() for encoded text, doesn't break html entities (" and other)
|
||||
/proc/copytext_preserve_html(var/text, var/first, var/last)
|
||||
return html_encode(copytext(html_decode(text), first, last))
|
||||
|
||||
//For generating neat chat tag-images
|
||||
//The icon var could be local in the proc, but it's a waste of resources
|
||||
@@ -283,4 +287,4 @@ proc/TextPreview(var/string,var/len=40)
|
||||
/proc/create_text_tag(var/tagname, var/tagdesc = tagname, var/client/C = null)
|
||||
if(C && (C.prefs.toggles & CHAT_NOICONS))
|
||||
return tagdesc
|
||||
return "<IMG src='\ref[text_tag_icons.icon]' class='text_tag' iconstate='[tagname]'" + (tagdesc ? " alt='[tagdesc]'" : "") + ">"
|
||||
return "<IMG src='\ref[text_tag_icons.icon]' class='text_tag' iconstate='[tagname]'" + (tagdesc ? " alt='[tagdesc]'" : "") + ">"
|
||||
@@ -304,7 +304,7 @@
|
||||
if(lentext(msg) <= 40)
|
||||
return "\blue [msg]"
|
||||
else
|
||||
return "\blue [copytext(msg, 1, 37)]... <a href='byond://?src=\ref[src];flavor_more=1'>More...</a>"
|
||||
return "\blue [copytext_preserve_html(msg, 1, 37)]... <a href='byond://?src=\ref[src];flavor_more=1'>More...</a>"
|
||||
|
||||
/*
|
||||
/mob/verb/help()
|
||||
|
||||
Reference in New Issue
Block a user