mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-18 08:13:40 +08:00
client: Apply syntax highlight to included notes
This commit is contained in:
parent
dfa4f3cd84
commit
00209ec77a
@ -10,6 +10,7 @@ import treeService from "./tree.js";
|
|||||||
import FNote from "../entities/fnote.js";
|
import FNote from "../entities/fnote.js";
|
||||||
import FAttachment from "../entities/fattachment.js";
|
import FAttachment from "../entities/fattachment.js";
|
||||||
import imageContextMenuService from "../menus/image_context_menu.js";
|
import imageContextMenuService from "../menus/image_context_menu.js";
|
||||||
|
import { applySyntaxHighlight } from "./syntax_highlight.js";
|
||||||
|
|
||||||
let idCounter = 1;
|
let idCounter = 1;
|
||||||
|
|
||||||
@ -105,6 +106,8 @@ async function renderText(note, $renderedContent) {
|
|||||||
for (const el of referenceLinks) {
|
for (const el of referenceLinks) {
|
||||||
await linkService.loadReferenceLinkTitle($(el));
|
await linkService.loadReferenceLinkTitle($(el));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
applySyntaxHighlight($renderedContent);
|
||||||
} else {
|
} else {
|
||||||
await renderChildrenList($renderedContent, note);
|
await renderChildrenList($renderedContent, note);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import attributeRenderer from "./attribute_renderer.js";
|
|||||||
import libraryLoader from "./library_loader.js";
|
import libraryLoader from "./library_loader.js";
|
||||||
import treeService from "./tree.js";
|
import treeService from "./tree.js";
|
||||||
import utils from "./utils.js";
|
import utils from "./utils.js";
|
||||||
import { applySyntaxHighlight } from "./syntax_highlight.js";
|
|
||||||
|
|
||||||
const TPL = `
|
const TPL = `
|
||||||
<div class="note-list">
|
<div class="note-list">
|
||||||
@ -369,8 +368,6 @@ class NoteListRenderer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
applySyntaxHighlight($renderedContent);
|
|
||||||
|
|
||||||
$content.append($renderedContent);
|
$content.append($renderedContent);
|
||||||
$content.addClass(`type-${type}`);
|
$content.addClass(`type-${type}`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user