Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ export default {
return finds.length ? finds[0]["original-name"] : null;
},
async loadPageNotes(page, uri, title, noteMap) {
const { itemsAsLinks } =
logseq.settings;
if (!page || !uri) return;

const pageProperties = {
Expand Down Expand Up @@ -352,9 +354,15 @@ export default {

for (const n of n_b) {
const { hid, updated } = n.properties;
const content = n.content.trim();
let content = n.content.trim();
const { parent, after } = n;
const source = blockMap.get(parent ?? after);

if (itemsAsLinks){
//then we want the content to be wrapped in a link that references the annotation on the url that the item originiated from
content = `<a href="${uri + "#annotations:" + hid}">${content}</a>`;
}

const block = await logseq.Editor.insertBlock(
source?.uuid ?? page.name,
content,
Expand Down
6 changes: 6 additions & 0 deletions src/settingsSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,11 @@
"key": "deletedFormat",
"title": "Deleted Content Format",
"type": "string"
},
{
"default": false,
"key": "itemsAsLinks",
"title": "Make the notes, highlights and annotations links to the hypothes.is page",
"type": "boolean"
}
]