HomeClusterLabs Projects

Refactor: libcrmcommon: New pcmk__xml_escape_attr_pretty enum value

Description

Refactor: libcrmcommon: New pcmk__xml_escape_attr_pretty enum value

Not used yet.

"attr_pretty" is a bit vague, but "attr_text" would be confusing since
we already have "attr" and "text". The idea is that this will be used
for text output formatter functions to create user-friendly ("pretty")
output.

The motivation for escaping '\n' and '\t' is to preserve compatibility
with existing external tools that parse text output and depend on
whitespace being represented in that way. Ideally, a newline would be
displayed as a literal line break, and a tab would be displayed as a
literal tab.

Break pcmk__xml{,_needs}_escape() into multiple nested switch statements
to avoid "if" blocks getting out of hand within the main switch.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Mar 26 2024, 9:17 PM
Parents
rPbf22fe296ce8: Refactor: libcrmcommon: New enum pcmk__xml_escape_type
Branches
Unknown
Tags
Unknown