Skip to content

Commit

Permalink
more work on doc generation
Browse files Browse the repository at this point in the history
  • Loading branch information
daimor committed Dec 16, 2024
1 parent e777cee commit efa7cf7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
14 changes: 9 additions & 5 deletions plugins/cls-loader/src/plugin/classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,18 @@ function reshapeHTML(text) {
text = text.join(" ");
}
text = text.replaceAll(/<[^>]*>/gi, "");
text = text.replaceAll(/({|}|\[|\])/g, "\\$1");
text = text.replaceAll("{", "&#123;");
text = text.replaceAll("}", "&#125;");
// text = text.replaceAll(/({|}|\[|\])/g, "\\$1");

text = text.replaceAll(/\<br\s*\/?\>/gi, "\n\n");
text = text.replaceAll(/\<\/?p\>/gi, "\n\n");
text = text.replaceAll(/\<br\s*\/?\>/gi, "<br />");
text = text.replaceAll(/<\/?p[^>]*>/gi, "\n\n");
text = text.replaceAll(/<\/?span[^>]*>/gi, "\n\n");
text = text.replaceAll(/\<\/?pre\>/gi, "\n```\n");
text = text.replaceAll(/\<\/?var\>/gi, "`");
text = text.replaceAll(/\<\/?ul\>/gi, "");
text = text.replaceAll(/\<li\>/gi, "\n* ");
text = text.replaceAll(/\<\/li\>/gi, "`");
text = text.replaceAll(/\<\/li\>/gi, "");
text = text.replaceAll(/\<\/?code\>/gi, "`");
text = text.replaceAll(/\<\/Description>/gi, "");
text = text.replaceAll(/\<example[^\>]*>/gi, "\n```\n");
Expand All @@ -231,7 +234,8 @@ function reshapeHTML(text) {
text = text.replace(found, classLink);
}

let result = "```" + text + "```\n\n";
let result = `<div>${text}</div>\n\n`;
// let result = "```" + text + "```\n\n";
// const htmlValidate = new HtmlValidate();
// let report = htmlValidate.validateStringSync(text);
// if (!report.valid) {
Expand Down
Empty file.
1 change: 0 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[
"2024.2",
"2024.1"
]

0 comments on commit efa7cf7

Please sign in to comment.