add: api.convert.annotation2html new option ignoreBody

This commit is contained in:
windingwind 2024-07-24 21:35:50 +08:00
parent 22d4e784be
commit 3482cda67f

View File

@ -224,6 +224,7 @@ export async function parseAnnotationHTML(
annotations: Zotero.Item[],
options: {
noteItem?: Zotero.Item; // If you are sure there are no image annotations, note is not required.
ignoreBody?: boolean;
ignoreComment?: boolean;
skipCitation?: boolean;
} = {},
@ -234,6 +235,10 @@ export async function parseAnnotationHTML(
if (options.ignoreComment && annotJson?.comment) {
annotJson.comment = "";
}
if (options.ignoreBody && annotJson?.text && annotJson?.comment) {
annotJson.text = annotJson.comment;
annotJson.comment = "";
}
annotationJSONList.push(annotJson!);
}