Skip to content

[BUG]: Nested (atomic) template tags break rendering on special inputs #92

Description

@jaxley

Was having this issue with 2.4.0beta6 and beta7. Downgraded to 2.3.1 and still has this issue

Readwise Mirror: Error during sync: Template render error: (unknown path) [Line 32, Column 25]
  unexpected token: }
    at Object._prettifyError (plugin:readwise-mirror:466:13)
    at Template.render (plugin:readwise-mirror:3062:23)
    at Environment.renderString (plugin:readwise-mirror:2933:19)
    at Atomizer.atomize (plugin:readwise-mirror:7377:36)
    at ReadwiseMirror.processReadwiseLibrary (plugin:readwise-mirror:17361:47)
    at async ReadwiseMirror.writeLibraryToMarkdown (plugin:readwise-mirror:17207:31)
    at async ReadwiseMirror.sync (plugin:readwise-mirror:17458:17)
    at async ReadwiseMirror.download (plugin:readwise-mirror:17490:9)
error @ plugin:readwise-mirror:8863
sync @ plugin:readwise-mirror:17477
await in sync
download @ plugin:readwise-mirror:17490
await in download
K6 @ app.js:1
t.onChooseItem @ app.js:1
t.onChooseSuggestion @ app.js:1
t.selectSuggestion @ app.js:1
e.useSelectedItem @ app.js:1
(anonymous) @ app.js:1
e.handleKey @ app.js:1
e.onKeyEvent @ app.js:1

It seems to fail on a specific book, processing a specific deleted highlight.

{
    "id": 899850250,
    "is_deleted": true,
    "text": "At this juncture, the \"we didn't know\" or \"we don't have the expertise\" excuses do not fly anymore. If you don't know how to balance your books and comply with tax laws and regulations, you hire an accountant. If you don't know anything about labor regulations, running payroll or managing personnel, you get yourself a human resources professional. If you don't know *anything* about *any* law at all, you hire a lawyer. Don't know anything about cybersecurity? You know what to do. That's the price of doing business right now.",
    "location": 2119011,
    "location_type": "offset",
    "note": "",
    "color": "",
    "highlighted_at": "2025-06-06T16:58:47.520Z",
    "created_at": "2025-06-06T16:58:47.575Z",
    "updated_at": "2025-06-06T16:58:47.575Z",
    "external_id": "01jx32wha0znpgkt1ceb0jk38n",
    "end_location": null,
    "url": "https://read.readwise.io/read/01jx32wha0znpgkt1ceb0jk38n",
    "book_id": 52230589,
    "tags": [],
    "is_favorite": false,
    "is_discard": false,
    "readwise_url": "https://readwise.io/open/899850250"
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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