Module utils

Source
Expand description

Random assortment of functions that are used internally to write plugins.

Functions§

calc_right_whitespace_with_tabstops
Calculate trailing whitespace with total length of indent.
cut_right_whitespace_with_tabstops
Returns trailing whitespace with total length of indent.
escape_html
Escape < > " & with corresponding HTML entities;
find_indent_of
Calculate the number of spaces from pos to the first non-space character or EOL.
get_entity_from_str
Check if “&xxxx;” string is a valid HTML entity, return character it represents.
is_punct_char
Checks whether a given character should count as punctuation
is_valid_entity_code
Return true if a code you got from &#xHHHH; entity is a valid charcode.
normalize_reference
Unicode case folding and space normalization, used for reference labels.
rfind_and_count
Count number of characters since the last occurrence of char.
unescape_all
Unescape both entities (&quot; -> ") and backslash escapes (\" -> ").