@@ -203,9 +203,8 @@ function reshapeHTML(text) {
203
203
text = text . join ( " " ) ;
204
204
}
205
205
text = text . replaceAll ( / < [ ^ > ] * > / gi, "" ) ;
206
- text = text . replaceAll ( / \[ / gi, "[" ) ;
207
- return text ;
208
- text = text . replaceAll ( / \] / gi, "]" ) ;
206
+ text = text . replaceAll ( / ( { | } | \[ | \] ) / g, "\\$1" ) ;
207
+
209
208
text = text . replaceAll ( / \< b r \s * \/ ? \> / gi, "\n\n" ) ;
210
209
text = text . replaceAll ( / \< \/ ? p \> / gi, "\n\n" ) ;
211
210
text = text . replaceAll ( / \< \/ ? p r e \> / gi, "\n```\n" ) ;
@@ -259,10 +258,11 @@ function membersToMarkdown(
259
258
entries . forEach ( ( [ key , member ] ) => {
260
259
doc += `### ${ member . name } \n\n` ;
261
260
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
+ }
266
266
} ) ;
267
267
268
268
return doc ;
@@ -288,6 +288,9 @@ ${asCode(classContent)}
288
288
${ asCode ( classDef . Class . code ) }
289
289
290
290
${ noCode ? "" : originalCode }
291
+
292
+ ${ reshapeHTML ( classDef . Class . description . join ( " " ) ) }
293
+
291
294
` ;
292
295
documentation += membersToMarkdown (
293
296
classFile ,
0 commit comments