{RAW_HTML}

This commit is contained in:
Crispy 2024-08-03 22:03:14 +02:00
parent 148dad8d83
commit 8541595f98

View file

@ -3,6 +3,7 @@ enum S {
None, None,
P, P,
Code, Code,
Html,
} }
pub fn convert_document(markdown: &str) -> String { pub fn convert_document(markdown: &str) -> String {
@ -24,6 +25,18 @@ pub fn convert_document(markdown: &str) -> String {
continue; continue;
} }
if line.starts_with("{RAW_HTML}") {
if state == S::Html {
state = S::None;
} else {
if state == S::P {
html += "</p>\n";
}
state = S::Html;
}
continue;
}
if state == S::Code { if state == S::Code {
html += line; html += line;
html += "\n"; html += "\n";