/tg/ Station 13 - Modules - TypesDefine Details

code/__HELPERS/text.dm

/proc/sanitize_namereturns nothing with an alert instead of the message if it contains something in the ic filter, and sanitizes normally if the name is fine. It returns nothing so it backs out of the input the same way as if you had entered nothing.
/proc/sanitizeRuns byond's html encoding sanitization proc, after replacing new-lines and tabs for the # character.
/proc/strip_htmlRuns STRIP_HTML_SIMPLE and sanitize.
/proc/strip_html_fullRuns STRIP_HTML_FULL and sanitize.
/proc/adminscrubRuns STRIP_HTML_SIMPLE and byond's sanitization proc.
/proc/htmlrendertextPerform a whitespace cleanup on the text, similar to what HTML renderers do
/proc/reject_bad_textReturns the text if properly formatted, or null else.
/proc/stripped_inputUsed to get a properly sanitized input. Returns null if cancel is pressed.
/proc/stripped_multiline_inputUsed to get a properly sanitized input in a larger box. Works very similarly to stripped_input.
/proc/reject_bad_nameFilters out undesirable characters from names.
/proc/permissive_sanitize_nameMuch more permissive version of reject_bad_name(). Returns a trimmed string or null if the name is invalid. Allows most characters except for IC chat prohibited words.
/proc/filter_name_icHelper proc to check if a name is valid for the IC filter
/proc/truncateTruncate a string to the given length
/proc/full_capitalizeReturns a string with the first letter of each word capitialized
/proc/int_to_wordsTakes a 1, 2 or 3 digit number and returns it in words. Don't call this directly, use convert_integer_to_words() instead.
/proc/convert_integer_to_wordsTakes an integer up to 999,999,999 and returns it in words. Works with negative numbers and 0.
is_lowercase_characterChecks if the char is lowercase
is_uppercase_characterChecks if the char is uppercase
is_digitChecks if the char is a digit
/proc/siunitFormats a number to human readable form with the appropriate SI unit.
/proc/siunit_pressure
/proc/scramble_message_replace_charsSlightly expensive proc to scramble a message using equal probabilities of character replacement from a list. DOES NOT SUPPORT HTML!
/proc/piglatin_sentenceruns piglatin_word() proc on each word in a sentence. preserves caps and punctuation
/proc/piglatin_wordtakes "word", and returns it piglatinized.
/proc/reject_bad_chattextThe procedure to check the text of the entered text on ntnrc_client.dm
/proc/format_textProperly format a string of text by using replacetext()
/proc/weight_class_to_textReturns a string based on the weight class define used as argument
/proc/sanitize_css_class_nameRemoves all non-alphanumerics from the text, keep in mind this can lead to id conflicts
/proc/semver_to_listConverts a semver string into a list of numbers
/proc/endswithReturns TRUE if the input_text ends with the ending
/proc/starts_with_anyReturns TRUE if the input_text starts with any of the beginnings
/proc/grawlixGenerate a grawlix string of length of the text argument.
STRIPPED_PUNCTUATIONAll punctuation that can be stripped in strip_outer_punctuation()
/proc/strip_outer_punctuationRemoves all punctuation sequences from the beginning and the end of the input string. Includes emphasis (|, +, _) and whitespace. Anything punctuation in the middle of the input will be maintained.
/proc/find_last_punctuationFind what punctuation is at the end of the input, returns it. Ignores emphasis (|, +, _)
/proc/is_uppercaseChecks if the passed string is all uppercase, ignoring punctuation and numbers and symbols

Define Details

STRIPPED_PUNCTUATION

All punctuation that can be stripped in strip_outer_punctuation()

is_digit

Checks if the char is a digit

is_lowercase_character

Checks if the char is lowercase

is_uppercase_character

Checks if the char is uppercase