Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix VBox and HBox docs not opening #755

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 27 additions & 25 deletions src/providers/documentation_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function make_symbol_document(symbol: GodotNativeSymbol): string {
const ret_type = make_link(parts[2] || "void", undefined);
let args = (parts[1] || "").replace(
/\:\s([A-z0-9_]+)(\,\s*)?/g,
": <a href=\"\" onclick=\"inspect('$1')\">$1</a>$2",
': <a href="" onclick="inspect(\'$1\')">$1</a>$2',
);
args = args.replace(/\s=\s(.*?)[\,\)]/g, "");
return `${ret_type} ${with_class ? `${classlink}.` : ""}${element("a", s.name, {
Expand Down Expand Up @@ -180,7 +180,7 @@ export function make_symbol_document(symbol: GodotNativeSymbol): string {
}
const args = (parts[2] || "").replace(
/\:\s([A-z0-9_]+)(\,\s*)?/g,
": <a href=\"\" onclick=\"inspect('$1')\">$1</a>$2",
': <a href="" onclick="inspect(\'$1\')">$1</a>$2',
);
const title = element(
"p",
Expand Down Expand Up @@ -233,28 +233,30 @@ export function make_symbol_document(symbol: GodotNativeSymbol): string {
let propertyies = "";
let others = "";

for (const s of symbol.children as GodotNativeSymbol[]) {
const elements = make_symbol_elements(s);
switch (s.kind) {
case SymbolKind.Property:
case SymbolKind.Variable:
properties_index += element("li", elements.index);
propertyies += element("li", elements.body, { id: s.name });
break;
case SymbolKind.Constant:
constants += element("li", elements.body, { id: s.name });
break;
case SymbolKind.Event:
signals += element("li", elements.body, { id: s.name });
break;
case SymbolKind.Method:
case SymbolKind.Function:
methods_index += element("li", elements.index);
methods += element("li", elements.body, { id: s.name });
break;
default:
others += element("li", elements.body, { id: s.name });
break;
if (symbol.children) {
for (const s of symbol.children as GodotNativeSymbol[]) {
const elements = make_symbol_elements(s);
switch (s.kind) {
case SymbolKind.Property:
case SymbolKind.Variable:
properties_index += element("li", elements.index);
propertyies += element("li", elements.body, { id: s.name });
break;
case SymbolKind.Constant:
constants += element("li", elements.body, { id: s.name });
break;
case SymbolKind.Event:
signals += element("li", elements.body, { id: s.name });
break;
case SymbolKind.Method:
case SymbolKind.Function:
methods_index += element("li", elements.index);
methods += element("li", elements.body, { id: s.name });
break;
default:
others += element("li", elements.body, { id: s.name });
break;
}
}
}

Expand Down Expand Up @@ -330,7 +332,7 @@ function format_documentation(bbcode: string, classname: string) {
let html = parser.parse(bbcode.trim());

html = html.replaceAll(/\[\/?codeblocks\](<br\/>)?/g, "");
html = html.replaceAll("&quot;", "\"");
html = html.replaceAll("&quot;", '"');

for (const match of html.matchAll(/\[codeblock].*?\[\/codeblock]/gs)) {
let block = match[0];
Expand Down
Loading