diff --git a/src/convert.rs b/src/convert.rs index 7ed082d..e3ce4b1 100644 --- a/src/convert.rs +++ b/src/convert.rs @@ -3,6 +3,7 @@ enum S { None, P, Code, + Html, } pub fn convert_document(markdown: &str) -> String { @@ -24,6 +25,18 @@ pub fn convert_document(markdown: &str) -> String { continue; } + if line.starts_with("{RAW_HTML}") { + if state == S::Html { + state = S::None; + } else { + if state == S::P { + html += "

\n"; + } + state = S::Html; + } + continue; + } + if state == S::Code { html += line; html += "\n";