Skip to content

Commit bb4df2c

Browse files
committed
added descriptions
1 parent 88e4cdf commit bb4df2c

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

.github/workflows/build.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
- main
66
pull_request:
77
jobs:
8-
test:
9-
name: Test
8+
build:
9+
name: Build
1010
runs-on: ubuntu-latest
1111
strategy:
1212
fail-fast: true
@@ -17,4 +17,3 @@ jobs:
1717
node-version: 20
1818
- run: yarn install --immutable
1919
- run: yarn run build
20-
- run: yarn run check

plugins/cls-loader/src/plugin/classes.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,8 @@ function reshapeHTML(text) {
203203
text = text.join(" ");
204204
}
205205
text = text.replaceAll(/<[^>]*>/gi, "");
206-
text = text.replaceAll(/\[/gi, "[");
207-
return text;
208-
text = text.replaceAll(/\]/gi, "]");
206+
text = text.replaceAll(/({|}|\[|\])/g, "\\$1");
207+
209208
text = text.replaceAll(/\<br\s*\/?\>/gi, "\n\n");
210209
text = text.replaceAll(/\<\/?p\>/gi, "\n\n");
211210
text = text.replaceAll(/\<\/?pre\>/gi, "\n```\n");
@@ -259,10 +258,11 @@ function membersToMarkdown(
259258
entries.forEach(([key, member]) => {
260259
doc += `### ${member.name}\n\n`;
261260
doc += `${asCode(member.code)}\n\n`;
262-
let description = member.description.join(" ");
263-
// description = reshapeHTML(member.description);
264-
// doc += description;
265-
// doc += "\n\n";
261+
if (member.description.length) {
262+
let description = member.description.join(" ");
263+
description = reshapeHTML(member.description);
264+
doc += `${description}\n\n`;
265+
}
266266
});
267267

268268
return doc;
@@ -288,6 +288,9 @@ ${asCode(classContent)}
288288
${asCode(classDef.Class.code)}
289289
290290
${noCode ? "" : originalCode}
291+
292+
${reshapeHTML(classDef.Class.description.join(" "))}
293+
291294
`;
292295
documentation += membersToMarkdown(
293296
classFile,

0 commit comments

Comments
 (0)