pub enum StrictSetting {
Mode(StrictMode),
Bool(bool),
Function(Arc<StrictFunction>),
}
Expand description
Configuration for strict mode behavior in KaTeX parsing and rendering.
This enum allows flexible configuration of how KaTeX handles non-standard LaTeX input. It can be set to a fixed strictness level, a simple boolean, or a custom function for dynamic strictness decisions based on context.
§LaTeX/KaTeX Context
Strict mode controls KaTeX’s adherence to LaTeX standards. When enabled, KaTeX will report or reject input that deviates from standard LaTeX syntax, helping catch errors and ensure compatibility. The function variant allows fine-grained control over which inputs are considered strict violations.
§Cross-references
- See
StrictMode
for available strictness levels. - Used in
Settings
for global strict configuration. - Related to
StrictReturn
for function return values.
Variants§
Mode(StrictMode)
Fixed strict mode level applied to all inputs.
Uses the specified StrictMode
for all parsing decisions.
Bool(bool)
Boolean strict setting for simple on/off control.
true
maps toStrictMode::Error
(strict).false
maps toStrictMode::Ignore
(non-strict).
Function(Arc<StrictFunction>)
Custom function for dynamic strictness evaluation.
The function receives error code, message, and optional location,
returning an optional StrictReturn
to determine behavior.
§Function Parameters
error_code
: String identifier for the type of strict violation.error_msg
: Human-readable description of the issue.token
: Optional location information for error reporting.
§Function Return
Some(StrictReturn)
to specify strictness behavior.None
to fall back to default behavior.
Trait Implementations§
Source§impl Clone for StrictSetting
impl Clone for StrictSetting
Source§fn clone(&self) -> StrictSetting
fn clone(&self) -> StrictSetting
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more