added shareAlias label

This commit is contained in:
zadam
2021-12-22 10:57:02 +01:00
parent bcef8579ce
commit c0964a4f12
10 changed files with 49 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
const {JSDOM} = require("jsdom");
const NO_CONTENT = '<p>This note has no content.</p>';
const shaca = require("./shaca/shaca");
function getChildrenList(note) {
if (note.hasChildren()) {
@@ -43,7 +44,15 @@ function getContent(note) {
if (href?.startsWith("#")) {
const notePathSegments = href.split("/");
linkEl.setAttribute("href", notePathSegments[notePathSegments.length - 1]);
const noteId = notePathSegments[notePathSegments.length - 1];
const linkedNote = shaca.getNote(noteId);
if (linkedNote) {
linkEl.setAttribute("href", linkedNote.shareId);
}
else {
linkEl.removeAttribute("href");
}
}
}