| Crates.io | rtf-to-html |
| lib.rs | rtf-to-html |
| version | 0.1.0 |
| created_at | 2025-12-17 16:54:36.390097+00 |
| updated_at | 2025-12-17 16:54:36.390097+00 |
| description | Convert RTF documents to HTML with semantic markup |
| homepage | |
| repository | https://github.com/TwelveTake-Studios/rtf-to-html |
| max_upload_size | |
| id | 1990703 |
| size | 25,732 |
Convert RTF documents to clean, semantic HTML.
If you find this crate useful, consider supporting development:
<strong>, <em>, <u>)<p> tags[dependencies]
rtf-to-html = "0.1"
use rtf_to_html::rtf_to_html;
let rtf = br#"{\rtf1\ansi\deff0 {\b Bold} and {\i italic} text}"#;
let html = rtf_to_html(rtf).unwrap();
// Output: <p><strong>Bold</strong> and <em>italic</em> text</p>
use rtf_to_html::rtf_to_plain_text;
let rtf = br#"{\rtf1\ansi\deff0 Hello World}"#;
let text = rtf_to_plain_text(rtf).unwrap();
// Output: Hello World
| RTF | HTML Output |
|---|---|
\b (bold) |
<strong> |
\i (italic) |
<em> |
\ul (underline) |
<u> |
\par (paragraph) |
<p> |
This crate focuses on basic text formatting. The following are not currently supported:
\field with HYPERLINK)Contributions welcome!
Licensed under either of:
at your option.
Built by TwelveTake Studios. Uses the rtf-parser crate for RTF parsing.