| 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_it::MarkdownIt::new(); |
| 13 | //! markdown_it::plugins::cmark::add(md); |
| 14 | //! markdown_it::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 | |
| 20 | pub mod html_block; |
| 21 | pub mod html_inline; |
| 22 | mod utils; |
| 23 | |
| 24 | use crate::MarkdownIt; |
| 25 | |
| 26 | pub fn add(md: &mut MarkdownIt) { |
| 27 | html_inline::add(md); |
| 28 | html_block::add(md); |
| 29 | } |