mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-02 13:02:00 +08:00
feat(in-app-help): adapt to no HTML wrapper
This commit is contained in:
parent
460014e54f
commit
8ecefa4eec
@ -35,9 +35,6 @@ export default function renderDoc(note: FNote) {
|
|||||||
function processContent(url: string, $content: JQuery<HTMLElement>) {
|
function processContent(url: string, $content: JQuery<HTMLElement>) {
|
||||||
const dir = url.substring(0, url.lastIndexOf("/"));
|
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.
|
// 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) => {
|
$content.find("img").each((i, el) => {
|
||||||
const $img = $(el);
|
const $img = $(el);
|
||||||
@ -48,14 +45,8 @@ function processContent(url: string, $content: JQuery<HTMLElement>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getUrl(docNameValue: string, language: string) {
|
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.
|
// Cannot have spaces in the URL due to how JQuery.load works.
|
||||||
docNameValue = docNameValue.replaceAll(" ", "%20");
|
docNameValue = docNameValue.replaceAll(" ", "%20");
|
||||||
|
|
||||||
return `${window.glob.appPath}/doc_notes/${language}/${docNameValue}.html${suffix}`;
|
return `${window.glob.appPath}/doc_notes/${language}/${docNameValue}.html`;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ const TPL = /*html*/`<div class="note-detail-doc note-detail-printable">
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="note-detail-doc-content"></div>
|
<div class="note-detail-doc-content ck-content"></div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
export default class DocTypeWidget extends TypeWidget {
|
export default class DocTypeWidget extends TypeWidget {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user