Module strings

Source
Expand description

Defines functions for string creation/manipulation.

Functions§

build_filename_and_sanitize
Builds a filename from a file stem and extension and sanitizes the output string.
convert_all_to_ascii
Converts all Unicode characters to their ASCII equivalent.
convert_symbols_to_ascii
Converts a subset of “smart” Unicode symbols to their ASCII equivalents.
extract_tags
Extracts all #tags from a string.
normalize_whitespace
Trims whitespace and replaces all linebreaks with: \n\n.
remove_tags
Removes all #tags from a string.
render_and_sanitize
Renders a one-off template string with a context and sanitizes the output string.
sanitize
Removes/replaces problematic characters from a string.
strip
Strips a string of a set of characters.
to_slug
Slugifies a string.
to_slug_date
Slugifies a date.
trim_blocks
Normalizes linebreaks by replacing three or more consecutive linebreaks with two consecutive linebreaks while leaving a single trailing linebreak.