SS1984 - Modules - Types

code/__HELPERS/text.dm

/proc/strip_html_simpleSimply removes < and > and limits the length of the message
/proc/sanitize_simpleRemoves a few problematic characters
/proc/sanitizeRuns byond's sanitization proc along-side sanitize_simple
/proc/filename_sanitizeGut ANYTHING that isnt alphanumeric, or brackets
/proc/paranoid_sanitizeGut ANYTHING that isnt alphanumeric, or brackets
/proc/strip_htmlRuns sanitize and strip_html_simple I believe strip_html_simple() is required to run first to prevent '<' from displaying as '<' after sanitize() calls byond's html_encode()
/proc/stripped_multiline_inputUsed to get a properly sanitized multiline input, of max_length
/proc/adminscrubRuns byond's sanitization proc along-side strip_html_simple I believe strip_html_simple() is required to run first to prevent '<' from displaying as '<' that html_encode() would cause
/proc/reject_bad_textReturns null if there is any bad text in the string
/proc/stripped_inputUsed to get a sanitized input.
/proc/typing_inputUses client.typing to check if the popup should appear or not
/proc/reject_bad_nameFilters out undesirable characters from names
/proc/dd_hasprefix_caseChecks the beginning of a string for a specified sub-string. This proc is case sensitive Returns the position of the substring or 0 if it was not found
/proc/dd_hassuffixChecks the end of a string for a specified substring. Returns the position of the substring or 0 if it was not found
/proc/add_zeroAdds 'u' number of zeros ahead of the text 't'
/proc/trim_leftReturns a string with reserved characters and spaces before the first letter removed
/proc/trim_rightReturns a string with reserved characters and spaces after the last letter removed
/proc/trimReturns a string with reserved characters and spaces before the first word and after the last word removed.
/proc/trim_lengthReturns a string that does not exceed max_length characters in size
/proc/capitalizeReturns a string with the first element of the string capitalized.
/proc/numeric_endingReturns a string depending on number it receives
/proc/dd_limittextLimits the length of the text. Note: MAX_MESSAGE_LEN and MAX_NAME_LEN are widely used for this purpose
/proc/strip_html_properlyThis 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/TextPreviewUsed in preferences' SetFlavorText and human's set_flavor verb Previews a string of len or less length
/proc/copytext_preserve_htmlalternative copytext() for encoded text, doesn't break html entities (" and other)
/proc/pencode_to_htmlConverts pencode to HTML with various formatting options
/proc/convert_pencode_argConverts pencode arguments to HTML tags with safety checks Called by admin_pencode_to_html to handle custom tags
/proc/admin_pencode_to_htmlConverts pencode to HTML with additional admin-specific formatting Handles custom classes, styles, and images in pencode
/proc/html_to_pencodeConverts HTML back to pencode format
/proc/rot13Returns the rot13'ed text
/proc/apply_text_macrosUsed for applying byonds text macros to strings that are loaded at runtime
/proc/sanitize_filenameRemoves characters incompatible with file names.
/proc/format_si_suffixFormats num with an SI prefix.
/proc/endswithReturns TRUE if the input_text ends with the ending
/proc/format_textProperly format a string of text by using replacetext()
/proc/ionnumPicks a string of symbols to display as the law number for hacked or ion laws
/proc/escape_regex_smartEscapes regex special characters in a string for safe use in regular expressions