From 8541595f98be99db855b9bda94f0c40856c4c735 Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Sat, 3 Aug 2024 22:03:14 +0200 Subject: [PATCH] {RAW_HTML} --- src/convert.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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";