- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 223
 
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Is there an existing issue for this?
- I have searched the existing issues
 
Are you using the latest Zotero and the latest plugin?
- I have confirmed I'm using the latest Zotero and the latest plugin
 
Environment
- OS: Windows 11 24H2
 - Zotero Version: 7.0.22
 - Plugin Version: 2.5.5
 
Describe the bug
复现步骤:
- 在zotero中添加下划线类型的注释。
 - 使用笔记模板生成笔记。
 - 在笔记编辑页面显示注释颜色,underline类型的注释变成了highlight。
 
不使用annotations2html,使用Zotero.EditorInstanceUtilities.serializeAnnotations([{ ...(await Zotero.Annotations.toJSON(annoItem)), ...{ attachmentItemID: annoItem.parentID }}]);则无此问题。
可使用以下模板测试:
# This template is specifically for importing/sharing, using better 
# notes 'import from clipboard': copy the content and
# goto Zotero menu bar, click Tools->New Template from Clipboard.  
# Do not copy-paste this to better notes template editor directly.
name: "[item]Test for annotation extraction"
zoteroVersion: "7.0.22"
pluginVersion: "2.5.5"
savedAt: "2025-08-07T07:23:56.917Z"
content: |-
  ${{
      const attachments = Zotero.Items.get(topItem.getAttachments()).filter((i) => i.isPDFAttachment() || i.isSnapshotAttachment() || i.isEPUBAttachment());
      let annots = attachments[0].getAnnotations();
      let result = "";
      for (let annoItem of annots) {
          const res = Zotero.EditorInstanceUtilities.serializeAnnotations([{
              ...(await Zotero.Annotations.toJSON(annoItem)), ...{ attachmentItemID: annoItem.parentID }
          }]);
          result += "<b>zotero API</b>" + res.html;
          
          const htmlContent = await Zotero.BetterNotes.api.convert.annotations2html(
              [annoItem], 
              {
                  noteItem: targetNoteItem,
                  ignoreComment: false
              }
          );
          result += "<b>better notes API</b>" + htmlContent;
  
      }
      return result;
  }}$
2025-08-07.153857.mp4
Debug Output
Anything else?
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working