mirror of
https://github.com/zadam/trilium.git
synced 2026-05-07 09:15:49 +02:00
fix(print): add missing note title for links (content renderer aware of printing)
This commit is contained in:
@@ -35,6 +35,7 @@ export interface RenderOptions {
|
||||
/** Set of note IDs that have already been seen during rendering to prevent infinite recursion. */
|
||||
seenNoteIds?: Set<string>;
|
||||
showTextRepresentation?: boolean;
|
||||
isPrinting?: boolean;
|
||||
}
|
||||
|
||||
const CODE_MIME_TYPES = new Set(["application/json"]);
|
||||
|
||||
@@ -47,9 +47,13 @@ export async function postProcessRichContent(note: FNote | FAttachment, $rendere
|
||||
await froca.getNotes(noteIdsToPrefetch);
|
||||
|
||||
for (const el of referenceLinks) {
|
||||
const innerSpan = document.createElement("span");
|
||||
await link.loadReferenceLinkTitle($(innerSpan), el.href);
|
||||
el.replaceChildren(innerSpan);
|
||||
if (options.isPrinting) {
|
||||
await link.loadReferenceLinkTitle($(el));
|
||||
} else {
|
||||
const innerSpan = document.createElement("span");
|
||||
await link.loadReferenceLinkTitle($(innerSpan), el.href);
|
||||
el.replaceChildren(innerSpan);
|
||||
}
|
||||
}
|
||||
|
||||
await rewriteMermaidDiagramsInContainer($renderedContent[0] as HTMLDivElement);
|
||||
|
||||
@@ -31,7 +31,8 @@ export function ListPrintView({ note, noteIds: unfilteredNoteIds, onReady, onPro
|
||||
if (isNotePrintable(note)) {
|
||||
const content = await content_renderer.getRenderedContent(note, {
|
||||
trim: false,
|
||||
noChildrenList: true
|
||||
noChildrenList: true,
|
||||
isPrinting: true
|
||||
});
|
||||
|
||||
const contentEl = content.$renderedContent[0];
|
||||
|
||||
Reference in New Issue
Block a user