Skip to main content

Module cleaners

Module cleaners 

Source

Functions§

clean_bib_key
cleans a string down to characters acceptable for a bibliography key
clean_class_name
Clean string for use as a CSS class name (Perl: CleanClassName) Decomposes to NFD, removes non-alphanumeric chars, recomposes to NFC.
clean_id
cleans a string down to characters acceptable for an id attribute
clean_index_key
Clean string for use in index keys (Perl: CleanIndexKey) Applies NFC normalization and removes trailing punctuation.
clean_label
cleans a string down to characters acceptable for a label attribute
clean_url
cleans a string down to characters acceptable for a URL
compose_url
builds a complete url from fragments
normalize_bib_key
Return the bibkey in a form to ACTUALLY lookup (Perl: NormalizeBibKey) Usually use clean_bib_key to preserve key in the original form (case)
roman_aux
auxiliary helper for roman
substr
Perl’s substr($text, $offset, $len) for a non-negative offset and length: it counts CHARACTERS, so a byte slice of document text (year[2..4] on 1–250, 2023, witnesses 2308.14725, 2607.14650) panics where Perl reads on. Past the end it is empty, as Perl’s in-range substr is.
trimmed_comma_list
Split comma-separated text into trimmed tokens (Perl: TrimmedCommaList)