diff options
author | Emile <git@emile.space> | 2023-04-08 20:14:30 +0200 |
---|---|---|
committer | Emile <git@emile.space> | 2023-04-08 20:14:30 +0200 |
commit | 081b25ddca6e7106e8de8d10eefd75671050e717 (patch) | |
tree | fc82e9ef15c640f36e8dd8ad08171b561443415b | |
parent | 3793cc86b49310b2e9aa8a79c5c8109c8f87c230 (diff) | |
parent | 4af79170e715adab02ddfe20f6155f99159b2c70 (diff) |
Merge branch 'main' of https://github.com/HanEmile/vokobe
-rw-r--r-- | src/main.rs | 4 |
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> |