Skip to main content

rtf_to_styled

Function rtf_to_styled 

Source
pub fn rtf_to_styled(rtf: &str, style: DocStyle) -> StyledText
Expand description

Parse the RTF subset Day writes, plus the control words a real editor puts around it (docs/texteditor.md).

Reads: \b \i \ul \uldb \uld \ulwave \strike \fs \cf \highlight \f, the \fonttbl and \colortbl tables, \par \line \tab, \pard \ql \qc \qr \qj \li \sb \sa, \'hh and \uN escapes, and group nesting for style scoping. Skips {\*\…} destinations whole. Everything else is ignored, which is what keeps a Word document from producing garbage rather than nothing.

Day API ↩ Guides· daybrite.dev