Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
zzlb0224 committed Mar 6, 2024
1 parent 026eb94 commit 588254c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/modules/annotationsToNote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function unregister() {
}

async function saveNote(targetNoteItem: Zotero.Item, txt: string) {
await Zotero.BetterNotes.api.note.insert(targetNoteItem, txt, -1);
await Zotero.BetterNotes.api.note.insert(targetNoteItem, txt, -1);
// const editor= await Zotero.BetterNotes.api.editor.getEditorInstance(targetNoteItem.id)
// await Zotero.BetterNotes.api.editor.replace(editor,0,1e3,txt)
await targetNoteItem.saveTx();
Expand Down Expand Up @@ -261,7 +261,7 @@ async function exportNote({
const title = getTitleFromAnnotations(annotations);
//createNote 一定要在 getSelectedItems 之后,不然获取不到选择的条目
// 另一个问题是 会创建顶层条目触发另一个插件的 closeOtherProgressWindows
const note = await createNote(title);
const note = await createNote(title);
annotations = await convertHtml(annotations, note);
const getKeyGroup = (fn: (item: AnnotationRes) => string | number | symbol) =>
groupBy(annotations, fn)
Expand Down Expand Up @@ -318,7 +318,7 @@ function exportNoteOnlyImage(isCollection: boolean = false) {
exportNote({
toText: (annotations) =>
groupBy(annotations, (a) => a.pdfTitle)
.flatMap((pdfTitle, index,aa) => [
.flatMap((pdfTitle, index, aa) => [
`<h1> (${index + 1}/${aa.length}) ${pdfTitle.key} ${getCiteItemHtml(pdfTitle.values[0]?.item)} (${pdfTitle.values.length})</h1>`,
...pdfTitle.values.flatMap((b) => [
b.html
Expand All @@ -342,7 +342,7 @@ function exportNoteScale(isCollection: boolean = false) {
toText: (ans) =>
groupBy(ans, (a) => a.pdfTitle)
.sort((a, b) => (a.key > b.key ? 1 : -1))
.flatMap((a, index,aa) => [
.flatMap((a, index, aa) => [
`<h1>(${index + 1}/${aa.length}) ${a.key} ${getCiteItemHtmlWithPage(a.values[0].ann)}</h1>`,
a.values
.map((b) => `<h2>${getCiteAnnotationHtml(b.ann)}</h2>`)
Expand Down

0 comments on commit 588254c

Please sign in to comment.