diff --git a/src/note/noteExportWindow.ts b/src/note/noteExportWindow.ts index 94c7e8d..7a1b95e 100644 --- a/src/note/noteExportWindow.ts +++ b/src/note/noteExportWindow.ts @@ -220,6 +220,7 @@ class NoteExportWindow extends AddonBase { exportFile: exportFile, exportSingleFile: exportSingleFile, exportAutoSync: exportAutoSync, + exportHighlight: exportHighlight, embedLink: embedLink, exportNote: exportNote, exportCopy: exportCopy, diff --git a/src/note/noteParse.ts b/src/note/noteParse.ts index 86afaef..981b52d 100644 --- a/src/note/noteParse.ts +++ b/src/note/noteParse.ts @@ -708,6 +708,21 @@ class NoteParse extends AddonBase { return "[" + content + "](" + href + title + ")"; }, }); + + if (Zotero.Prefs.get("Knowledge4Zotero.exportHighlight")) { + turndownService.addRule("backgroundColor", { + filter: function (node, options) { + return node.nodeName === "SPAN" && node.style["background-color"]; + }, + + replacement: function (content, node) { + return `${content}`; + }, + }); + } + const parsedMD = turndownService.turndown(doc.body); console.log(parsedMD); return parsedMD;