Hello, Zotero Team,
Previously, I use the following codes to convert html to markdown.(these codes are also inside the Zotero own editorInstance.js file)
```
function html2markdown(html) {
let item = new Zotero.Item('note');
item.libraryID = Zotero.Libraries.userLibraryID;
item.setNote(html);
let text = '';
var translation = new Zotero.Translate.Export;
translation.noWait = true;
translation.setItems([item]);
translation.setTranslator(Zotero.Translators.TRANSLATOR_ID_NOTE_MARKDOWN);
translation.setHandler("done", (obj, worked) => {
if (worked) {
text = obj.string.replace(/\r\n/g, '\n');
}
});
translation.translate();
return text;
}
```
However, in Zotero 8, the codes fail to work.
Look forward to the favor from the Zotero Team. Thanks very much.