about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEmile <git@emile.space>2022-02-03 21:55:10 +0100
committerEmile <git@emile.space>2022-02-03 21:55:10 +0100
commit2d473af0fe018ae48ebe54eac0b2e7ff52f6b4ca (patch)
tree9a4f04507739ec0d19c8b364a48010377e1004bd /src
parent9f395a122d6cd66170c363a3ef50871d8d4a25b2 (diff)
improved the code rendering
Diffstat (limited to 'src')
-rw-r--r--src/main.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 80f0f83..55dd485 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -407,8 +407,9 @@ fn write_readme_content(file: &mut File, in_path: &Path, raw_path: &Path)
             <h1><a href="#{a}">{b}</a></h1>
             <pre>"##, a = heading_sanitized, b = heading).as_bytes())?;
 
-        } else if line.starts_with(">") {
-            let line = line.get(1..).unwrap();
+        } else if line.starts_with("> ") {
+            let line = line.replace("<", "&lt");
+            let line = line.get(2..).unwrap();
             file.write_all(format!("</pre><pre class=\"code\">{}</pre><pre>\n", line).as_bytes())?;
 
         } else if line.starts_with(":::tree") {