From 8ecefa4eecf91a5a7714610cb07af0948d5f5a22 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 12 Apr 2025 00:32:43 +0300 Subject: [PATCH] feat(in-app-help): adapt to no HTML wrapper --- src/public/app/services/doc_renderer.ts | 11 +---------- src/public/app/widgets/type_widgets/doc.ts | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/public/app/services/doc_renderer.ts b/src/public/app/services/doc_renderer.ts index 290adbb72..c8dac0ac0 100644 --- a/src/public/app/services/doc_renderer.ts +++ b/src/public/app/services/doc_renderer.ts @@ -35,9 +35,6 @@ export default function renderDoc(note: FNote) { function processContent(url: string, $content: JQuery) { const dir = url.substring(0, url.lastIndexOf("/")); - // Remove top-level heading since it's already handled by the note title - $content.find("h1").remove(); - // Images are relative to the docnote but that will not work when rendered in the application since the path breaks. $content.find("img").each((i, el) => { const $img = $(el); @@ -48,14 +45,8 @@ function processContent(url: string, $content: JQuery) { } function getUrl(docNameValue: string, language: string) { - // For help notes, we only get the content to avoid loading of styles and meta. - let suffix = ""; - if (docNameValue?.startsWith("User Guide")) { - suffix = " .content"; - } - // Cannot have spaces in the URL due to how JQuery.load works. docNameValue = docNameValue.replaceAll(" ", "%20"); - return `${window.glob.appPath}/doc_notes/${language}/${docNameValue}.html${suffix}`; + return `${window.glob.appPath}/doc_notes/${language}/${docNameValue}.html`; } diff --git a/src/public/app/widgets/type_widgets/doc.ts b/src/public/app/widgets/type_widgets/doc.ts index 477caea85..fcab8ce4b 100644 --- a/src/public/app/widgets/type_widgets/doc.ts +++ b/src/public/app/widgets/type_widgets/doc.ts @@ -53,7 +53,7 @@ const TPL = /*html*/`
} -
+
`; export default class DocTypeWidget extends TypeWidget {