Skip to content

Commit 4e7ea98

Browse files
RomainMullerrix0rrr
authored andcommitted
fix(java): Escape */ in package-info.java (#526)
Code examples in the `README.md` file can contain multi-line comments that will interfere with the comment block in `package-info.java`. Escaping the `*/` to `*{@literal /}` fixes that issue.
1 parent 7ffa98d commit 4e7ea98

File tree

21 files changed

+38
-25
lines changed

21 files changed

+38
-25
lines changed

packages/codemaker/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/jsii-calc/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ If this file starts with an "H1" line (in our case `# jsii Calculator`), this
1010
heading will be used as the Sphinx topic name. Otherwise, the name of the module
1111
(`jsii-calc`) will be used instead.
1212

13+
## Code Samples
1314

14-
15-
15+
```ts
16+
/* This is totes a magic comment in here, just you wait! */
17+
const foo = 'bar';
18+
```

packages/jsii-calc/test/assembly.jsii

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
},
198198
"name": "jsii-calc",
199199
"readme": {
200-
"markdown": "# jsii Calculator\n\nThis library is used to demonstrate and test the features of JSII\n\n## Sphinx\n\nThis file will be incorporated into the sphinx documentation.\n\nIf this file starts with an \"H1\" line (in our case `# jsii Calculator`), this\nheading will be used as the Sphinx topic name. Otherwise, the name of the module\n(`jsii-calc`) will be used instead.\n\n\n\n\n"
200+
"markdown": "# jsii Calculator\n\nThis library is used to demonstrate and test the features of JSII\n\n## Sphinx\n\nThis file will be incorporated into the sphinx documentation.\n\nIf this file starts with an \"H1\" line (in our case `# jsii Calculator`), this\nheading will be used as the Sphinx topic name. Otherwise, the name of the module\n(`jsii-calc`) will be used instead.\n\n## Code Samples\n\n```ts\n/* This is totes a magic comment in here, just you wait! */\nconst foo = 'bar';\n```\n"
201201
},
202202
"repository": {
203203
"type": "git",
@@ -8604,5 +8604,5 @@
86048604
}
86058605
},
86068606
"version": "0.11.1",
8607-
"fingerprint": "uCNbkp5+1duLs9lW2h4C+T4dTtV6ZArNhzgT39ChGpk="
8607+
"fingerprint": "9L8/rsLS+UYbDYN+YX0Wb3gybgQNUCyFdD52GKTWEs0="
86088608
}

packages/jsii-diff/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/jsii-dotnet-jsonmodel/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/jsii-dotnet-runtime-test/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/jsii-dotnet-runtime/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/jsii-java-runtime/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/jsii-kernel/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/jsii-pacmak/lib/targets/java.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ class JavaGenerator extends Generator {
365365
this.code.line('/**');
366366
if (mod.readme) {
367367
for (const line of md2html(mod.readme.markdown).split('\n')) {
368-
this.code.line(` * ${line}`);
368+
this.code.line(` * ${line.replace(/\*\//g, '*{@literal /}')}`);
369369
}
370370
}
371371
if (mod.docs.deprecated) {

0 commit comments

Comments
 (0)