{RAW_HTML}
This commit is contained in:
parent
148dad8d83
commit
8541595f98
1 changed files with 13 additions and 0 deletions
|
@ -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 += "</p>\n";
|
||||
}
|
||||
state = S::Html;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if state == S::Code {
|
||||
html += line;
|
||||
html += "\n";
|
||||
|
|
Loading…
Reference in a new issue