markdown_that/plugins/html/mod.rs
1//! Raw html syntax (block and inline), part of CommonMark standard.
2//!
3//! This feature is separated from cmark because it is unsafe to enable by
4//! default (due to lack of any kind of html sanitization).
5//!
6//! You can enable it if you're:
7//! - looking for strict CommonMark compatibility
8//! - only have trusted input (i.e. writing markdown yourself)
9//! - or took some care to sanitize html yourself
10//!
11//! ```rust
12//! let md = &mut markdown_that::MarkdownThat::new();
13//! markdown_that::plugins::cmark::add(md);
14//! markdown_that::plugins::html::add(md);
15//!
16//! let html = md.parse("hello<br>world").render();
17//! assert_eq!(html.trim(), r#"<p>hello<br>world</p>"#);
18//! ```
19
20pub mod html_block;
21pub mod html_inline;
22mod utils;
23
24use crate::MarkdownThat;
25
26pub fn add(md: &mut MarkdownThat) {
27 html_inline::add(md);
28 html_block::add(md);
29}