about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmile <git@emile.space>2023-04-08 20:14:30 +0200
committerEmile <git@emile.space>2023-04-08 20:14:30 +0200
commit081b25ddca6e7106e8de8d10eefd75671050e717 (patch)
treefc82e9ef15c640f36e8dd8ad08171b561443415b
parent3793cc86b49310b2e9aa8a79c5c8109c8f87c230 (diff)
parent4af79170e715adab02ddfe20f6155f99159b2c70 (diff)
Merge branch 'main' of https://github.com/HanEmile/vokobe
-rw-r--r--src/main.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index e82d081..f6cdb8c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -475,6 +475,8 @@ fn write_readme_content(file: &mut File, in_path: &Path, raw_path: &Path)
             for line in readme.split('\n') {
                 if line.starts_with("###") {
                     let line = line.get(4..).unwrap();
+                    // trim the line to remove the trailing whitespace
+                    let line = line.trim();
                     file.write_all(
                         format!(
                             r##"       <a href="#{}">{}</a>
@@ -485,6 +487,7 @@ fn write_readme_content(file: &mut File, in_path: &Path, raw_path: &Path)
                     )?;
                 } else if line.starts_with("##") {
                     let line = line.get(3..).unwrap();
+                    let line = line.trim();
                     file.write_all(
                         format!(
                             r##"    <a href="#{}">{}</a>
@@ -495,6 +498,7 @@ fn write_readme_content(file: &mut File, in_path: &Path, raw_path: &Path)
                     )?;
                 } else if line.starts_with("#") {
                     let line = line.get(2..).unwrap();
+                    let line = line.trim();
                     file.write_all(
                         format!(
                             r##"<a href="#{}">{}</a>