Skip to content

Commit

Permalink
Escape the multiline-comment end sequence '*/' if it's included in a …
Browse files Browse the repository at this point in the history
…doc comment. The escaped sequence looks like this: '*\/'. (#3)
  • Loading branch information
mjoerussell authored Nov 28, 2024
1 parent a951a94 commit 51b184c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/js-component-bindgen/src/ts_bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,8 @@ impl<'a> TsInterface<'a> {
fn docs_raw(&mut self, docs: &str) {
self.src.push_str("/**\n");
for line in docs.lines() {
self.src.push_str(&format!(" * {}\n", line));
self.src
.push_str(&format!(" * {}\n", line.replace("*/", "*\\/")));
}
self.src.push_str(" */\n");
}
Expand Down

0 comments on commit 51b184c

Please sign in to comment.