diff --git a/docs/.vitepress/theme/index.css b/docs/.vitepress/theme/index.css
new file mode 100644
index 00000000000..21bbf49454b
--- /dev/null
+++ b/docs/.vitepress/theme/index.css
@@ -0,0 +1,3 @@
+table td * {
+ display: inline;
+}
diff --git a/docs/.vitepress/theme/index.mjs b/docs/.vitepress/theme/index.mjs
index 26a6b5caf75..b6bfbb86097 100644
--- a/docs/.vitepress/theme/index.mjs
+++ b/docs/.vitepress/theme/index.mjs
@@ -1,3 +1,4 @@
+import './index.css';
import GlobalComponents from './components';
import DefaultTheme from 'vitepress/theme';
diff --git a/scripts/apidoc.ts b/scripts/apidoc.ts
index 62fc9ed5762..e2b0d36abce 100644
--- a/scripts/apidoc.ts
+++ b/scripts/apidoc.ts
@@ -20,8 +20,14 @@ function toBlock(comment?: TypeDoc.Comment): string {
);
}
-function escape(value: string): string {
- return value.replace(/\|/g, '\\|').replace(//g, '\\>');
+// https://stackoverflow.com/a/6234804/6897682
+function escapeHtml(unsafe: string): string {
+ return unsafe
+ .replace(/&/g, '&')
+ .replace(//g, '>')
+ .replace(/"/g, '"')
+ .replace(/'/g, ''');
}
function parameterRow(
@@ -30,20 +36,22 @@ function parameterRow(
def?: string,
comment?: TypeDoc.Comment
): string {
- def = def ? `\`${def}\`` : '';
- return (
- '| ' +
- escape(name) +
- ' | ' +
- escape(type) +
- ' | ' +
- def +
- ' | ' +
- escape(toBlock(comment))
- .replace(/\n{2,}/, '
')
- .replace(/\n/, '') +
- '|\n'
- );
+ def = def ? `${def}
` : '';
+ return `
Name | +Type | +Default | +Description | +
---|