Skip to content

1.3.2 — Fix PDF annotation persistence

Choose a tag to compare

@gibsonchan-5 gibsonchan-5 released this 21 Aug 14:17
· 1 commit to main since this release

1.3.2 — Fix PDF annotation persistence

Bug Fixes

  • Fix: PDF annotations disappear after closing/reopening — The core issue was text matching failure in the textLayer
  • Root cause: Kangxi Radicals (U+2F00–U+2FD5) vs standard CJK (U+4E00–U+9FFF) encoding mismatch — PDF.js returns Kangxi Radicals for some Chinese text, while saved annotation text uses standard CJK characters
  • Fix: Use NFKC Unicode normalization for cross-encoding text matching
  • Fix: Remove space insertion between text nodes (broke CJK matching — Chinese text has no inter-word spaces)
  • Fix: Add retry mechanism with exponential backoff (500ms → 1s → 2s → 3s → 5s, max 6 attempts)
  • Fix: Async wait for textLayer to be rendered before matching

Community Review Compliance

  • All style.xxx =setCssStyles() / setCssProps()
  • All eslint-disable comments have descriptions
  • All setTimeoutwindow.setTimeout
  • localStorageplugin.settings
  • vault.deletevault.trash

Security

  • Added data.json to .gitignore to prevent API key leaks