Skip to content

Build your personal knowledge base with Trilium Notes

fix(client): `internalBookmark` not hidden

Elian Doran480da09bcca6
diff --git a/apps/client/src/services/attribute_renderer.ts b/apps/client/src/services/attribute_renderer.ts
index 01d6337367..c93620b3b2 100644
--- a/apps/client/src/services/attribute_renderer.ts
+++ b/apps/client/src/services/attribute_renderer.ts
@@ -7,6 +7,10 @@ async function renderAttribute(attribute: FAttribute, renderIsInheritable: boole
const isInheritable = renderIsInheritable && attribute.isInheritable ? `(inheritable)` : "";
const $attr = $("<span>");
+ if (attribute.isAutoLink) {
+ return $attr;
+ }
+
if (attribute.type === "label") {
$attr.append(document.createTextNode(`#${attribute.name}${isInheritable}`));
@@ -15,9 +19,6 @@ async function renderAttribute(attribute: FAttribute, renderIsInheritable: boole
$attr.append(document.createTextNode(formatValue(attribute.value)));
}
} else if (attribute.type === "relation") {
- if (attribute.isAutoLink) {
- return $attr;
- }
// when the relation has just been created, then it might not have a value
if (attribute.value) {
diff --git a/apps/client/src/widgets/ribbon/AutoLinkAttributesTab.tsx b/apps/client/src/widgets/ribbon/AutoLinkAttributesTab.tsx
index 132a55a8a3..1d54edbfb6 100644
--- a/apps/client/src/widgets/ribbon/AutoLinkAttributesTab.tsx
+++ b/apps/client/src/widgets/ribbon/AutoLinkAttributesTab.tsx
@@ -51,6 +51,10 @@ function AutoLinkAttribute({ attribute }: { attribute: FAttribute }) {
}
async function renderAutoLink(attribute: FAttribute) {
+ if (attribute.type === "label") {
+ return `#${escapeHtml(attribute.name)}=${escapeHtml(attribute.value)}`;
+ }
+
const note = await froca.getNote(attribute.value);
if (!note) return "";
diff --git a/apps/client/src/widgets/type_widgets/text/EditableText.tsx b/apps/client/src/widgets/type_widgets/text/EditableText.tsx
index a002cde7e9..760e00e489 100644
--- a/apps/client/src/widgets/type_widgets/text/EditableText.tsx
+++ b/apps/client/src/widgets/type_widgets/text/EditableText.tsx
@@ -264,13 +264,6 @@ export default function EditableText({ note, parentComponent, ntxId, noteContext
editor.setData(contentRef.current);
parentComponent?.triggerEvent("textEditorRefreshed", { ntxId, editor });
- // Scroll to bookmark anchor if navigated with ?bookmark=...
- const viewScope = noteContext?.viewScope;
- if (viewScope?.bookmark) {
- const el = editor.editing.view.getDomRoot()?.querySelector(`[id="${CSS.escape(viewScope.bookmark)}"]`);
- el?.scrollIntoView({ behavior: "smooth", block: "center" });
- viewScope.bookmark = undefined;
- }
}}
/>}