feat(in-app-help): adapt to no HTML wrapper

This commit is contained in:
Elian Doran 2025-04-12 00:32:43 +03:00
parent 460014e54f
commit 8ecefa4eec
No known key found for this signature in database
2 changed files with 2 additions and 11 deletions

View File

@ -35,9 +35,6 @@ export default function renderDoc(note: FNote) {
function processContent(url: string, $content: JQuery<HTMLElement>) {
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<HTMLElement>) {
}
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`;
}

View File

@ -53,7 +53,7 @@ const TPL = /*html*/`<div class="note-detail-doc note-detail-printable">
}
</style>
<div class="note-detail-doc-content"></div>
<div class="note-detail-doc-content ck-content"></div>
</div>`;
export default class DocTypeWidget extends TypeWidget {