pub enum WriteError {
InvalidHeadingLevel(u8),
NewlineInInlineElement(EcoString),
FmtError(EcoString),
IoError(Error),
UnsupportedNodeType,
InvalidStructure(EcoString),
InvalidHtmlTag(EcoString),
InvalidHtmlAttribute(EcoString),
HtmlRenderingError(HtmlWriteError),
HtmlFallbackError(EcoString),
Custom {
message: EcoString,
code: Option<EcoString>,
},
}Expand description
Errors that can occur during CommonMark writing.
Variants§
InvalidHeadingLevel(u8)
An invalid heading level was encountered (must be 1-6).
NewlineInInlineElement(EcoString)
A newline character was found in an inline element where it’s not allowed (e.g., in strict mode or specific contexts like table cells, link text, image alt text).
FmtError(EcoString)
An underlying formatting error occurred.
IoError(Error)
An underlying I/O error occurred.
UnsupportedNodeType
An unsupported node type was encountered.
InvalidStructure(EcoString)
Invalid structure in a node (e.g., mismatched table columns)
InvalidHtmlTag(EcoString)
An invalid HTML tag was found (contains unsafe characters)
InvalidHtmlAttribute(EcoString)
An invalid HTML attribute was found (contains unsafe characters)
HtmlRenderingError(HtmlWriteError)
An error occurred during dedicated HTML rendering.
HtmlFallbackError(EcoString)
An error occurred during HTML fallback rendering for tables with block elements.
Custom
A custom error with a message and optional error code.
Implementations§
Source§impl WriteError
Convenience methods for creating custom errors
impl WriteError
Convenience methods for creating custom errors