Style-markup-mode
StyleMarkupMode is the public enum that controls whether inline style tags should be parsed by a text formatter. It is a direct alias to the formatter enum used for message text, target text, and field-value rendering scopes.
Interface
pub type StyleMarkupMode = @utils.StyleMarkupModeoutput
StyleMarkupMode- Public formatter markup-policy enum with the variantsDisabled,Builtin, andFull.
Explanation
Detailed rules explaining key parameters and behaviors
- This is a type alias, not a wrapper or separate parser surface.
StyleMarkupMode::Disabledtreats inline markup as plain text.StyleMarkupMode::Builtinlimits tag resolution to the built-in tag set.StyleMarkupMode::Fullallows local style tags, global style tags, and built-in tags to participate in resolution.- The same enum is used by
style_markup,target_style_markup, andfields_style_markupin formatter APIs.
How to Use
Here are some specific examples provided.
When Need To Disable Inline Tag Parsing Entirely
When message text should remain literal even if it contains style-like tags:
let formatter = text_formatter(style_markup=StyleMarkupMode::Disabled)In this example, strings such as <accent>hello</> are kept as plain text.
When Need Only Built-in Tag Support
When formatters should allow the built-in tag vocabulary without opening custom registry behavior:
let formatter = text_formatter(style_markup=StyleMarkupMode::Builtin)In this example, built-in tags such as <warning>...</> can be resolved while custom registry tags are not the source of truth.
Error Case
e.g.:
StyleMarkupModeitself does not have a runtime failure mode.Unknown or invalid tags do not raise an error; current behavior falls back to plain text handling.
Notes
Use
style_markup_mode_label(...)when you need a stable string form for logging or assertions.Message, target, and field rendering each have their own markup scope, so one formatter can mix different markup policies deliberately.