basic support for internal links

This commit is contained in:
azivner
2017-08-27 14:39:26 -04:00
parent 80bfc5d1ac
commit 5e8edf4469
5 changed files with 48 additions and 33 deletions

View File

@@ -26,7 +26,16 @@ function notecase2html(note) {
}
}
else if (el.type === 'link') {
let linkHtml = '<a href="' + el.target_url + '">' + el.lnk_text + '</a>';
let targetUrl;
if (el.target_url) {
targetUrl = el.target_url;
}
else {
targetUrl = "app#" + el.target_note_id;
}
let linkHtml = '<a href="' + targetUrl + '">' + el.lnk_text + '</a>';
noteText = noteText.substr(0, el.note_offset + offset) + noteText.substr(el.note_offset + offset + el.lnk_text.length);