Skip to content

Commit

Permalink
fix: remove unexpected let e = if expr is too long (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
magic-akari authored Jan 2, 2024
1 parent dfcfa20 commit 5cdd130
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions markup_fmt/src/ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@ where
.saturating_sub(self.indent_level)
.saturating_sub(2), // this is technically wrong, just workaround
);
let formatted = formatted.trim_matches(|c: char| c.is_ascii_whitespace() || c == ';');
let formatted = formatted.trim_end_matches(|c: char| c.is_ascii_whitespace() || c == ';');
formatted
.strip_prefix("let e = ")
.strip_prefix("let e =")
.unwrap_or(formatted)
.trim_start()
.to_owned()
}
}
Expand Down

0 comments on commit 5cdd130

Please sign in to comment.