Skip to content

Sync failure on pdf highlights #14

@flip-rossi

Description

@flip-rossi

Currently, if you try to sync highlights from a pdf, it fails if you have more than one highlight, with the following log warning message:

09/23/25-18:23:55 ERROR failed to call event handler onSync plugins/highlightsync.koplugin/merge.lua:98: attempt to compare two table values

This is because the final sort step in the merge_highlights function assumes that each highlight's pos0 field is either not present or a number, but in pdf highlights it's a table like this one:

{
  page = 1,
  x = 104.1994818306,
  y = 267.63269399643,
  rotation = 0,
  zoom = 2.3128713863645
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions