Skip to content

Commit

Permalink
fix(jsii-pacmak): comment lines should not contain comment ending
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMSchmidt committed Jul 25, 2023
1 parent ef6e5b1 commit 02de42f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/jsii-pacmak/lib/targets/java.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2808,7 +2808,7 @@ class JavaGenerator extends Generator {

this.code.line('/**');
for (const line of lines) {
this.code.line(` * ${line}`);
this.code.line(` * ${escapeEndingComment(line)}`);
}
this.code.line(' */');
}
Expand Down Expand Up @@ -3677,3 +3677,8 @@ function myMarkDownToJavaDoc(source: string) {
function stripNewLines(x: string) {
return x.replace(/\n/g, '');
}

// Replace */ with *\/ to avoid closing the comment block
function escapeEndingComment(x: string) {
return x.replace(/\*\//g, '*\\/');
}

0 comments on commit 02de42f

Please sign in to comment.