Skip to content

Commit

Permalink
fix trim spaces bug in docslt
Browse files Browse the repository at this point in the history
Signed-off-by: Runji Wang <[email protected]>
  • Loading branch information
wangrunji0408 committed Oct 25, 2023
1 parent 3c4d55c commit 5069ef7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/risedevtool/src/bin/risedev-docslt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ fn extract_slt(filepath: &Path) -> Vec<SltBlock> {
if !(line.starts_with("///") || line.starts_with("//!")) {
panic!("expect /// or //! at {}:{}", filepath.display(), i + 1);
}
line = line[3..].trim();
if line == "```" {
line = &line[3..];
if line.trim() == "```" {
break;
}
content += line;
// strip one leading space
content += line.strip_prefix(' ').unwrap_or(line);
content += "\n";
}
blocks.push(SltBlock {
Expand Down

0 comments on commit 5069ef7

Please sign in to comment.