Support Google Keep JSON Import, Note Deduplication, and XML/Encoding Fixes#13
Open
schwegler wants to merge 2 commits into
Open
Support Google Keep JSON Import, Note Deduplication, and XML/Encoding Fixes#13schwegler wants to merge 2 commits into
schwegler wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds full support for importing Google Keep's native
.jsonexport format alongside the existing HTML format. It also implements note deduplication (prioritizing JSON files over HTML files when both are present in Google Takeout archives), maps native tags/checkboxes correctly to ENEX outputs, and fixes a character encoding issue in the zip extractor worker that caused emoji and tag corruption.Key Changes
1. Google Keep JSON Import Support & Auto-Deduplication
src/config/formats.js):detectFormatto look for folder structure indicators (e.g.,Keep/directories) or standard Takeout indexes likearchive_browser.htmlto robustly auto-detect Google Keep archives..htmland.jsonfiles as Google Keep formats.src/main.js):.jsonfile and a.htmlfile, the UI only displays the.jsonversion to avoid importing duplicate entries.archive_browser.html.src/main.js):parseKeepJson(content)to map native Google Keep schemas into internal note objects:listContent) into formatted HTML checkboxes.<br/>tags.createdTimestampUsec,userEditedTimestampUsec) to ISO strings.2. ENEX Export Refinement (
src/main.js)<input type="checkbox" checked="true"/>/<input type="checkbox"/>) to valid Evernote<en-todo checked="true"/>/<en-todo/>elements inside note bodies.&,<,>,",') to prevent invalid ENEX document generation, and appends them as standard<tag>Tag Name</tag>XML nodes.3. Worker UTF-8 Character Encoding Fix (
src/modules/worker.js)uint8arraybinary buffer instead of standard JSZipstringextraction.TextDecoder('utf-8')to decode the raw bytes. This ensures emojis, foreign characters, and custom tags are parsed correctly and do not suffer from character corruption.Files Changed
detectFormatlogic to recognize Keep directories and batch structures.parseKeepJson, deduplicated list/select actions, added<en-todo>and<tag>mappings.TextDecoderbuffer parsing.Verification & Testing
✨ Note Title 🏷️) and confirmed that they render without corruption.