Skip to content

docs(wasm): hand the diff to edit as generateDiff returns it - #783

Merged
andiwand merged 1 commit into
mainfrom
docs/wasm-readme-edit-diff
Aug 30, 2026
Merged

docs(wasm): hand the diff to edit as generateDiff returns it#783
andiwand merged 1 commit into
mainfrom
docs/wasm-readme-edit-diff

Conversation

@andiwand

@andiwand andiwand commented Aug 30, 2026

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

odr.generateDiff() ends in return JSON.stringify(result), so the README's
JSON.stringify around it hands edit a json string where html::edit
parses an object. json["modifiedText"] then throws:

[json.exception.type_error.305] cannot use operator[] with a string argument with string

Checked against 6.12.0 from npm, both ways, on a document rendered with
editable: true:

double-encoded -> OdrError: [json.exception.type_error.305] cannot use operator[] with a string argument with string
as returned    -> ok

Found while wiring the round trip into the opendocument.app viewer, which is
where the snippet gets copied from.

No CHANGELOG.md entry: the binding is unchanged, only what the README claims
about calling it.

`odr.generateDiff()` returns the json already stringified, so the README's
`JSON.stringify` around it handed `edit` a json string where it parses an
object: `json["modifiedText"]` then throws
`[json.exception.type_error.305] cannot use operator[] with a string argument
with string`. Checked against 6.12.0 both ways.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P4A5LwMDmeD3sxJ3MaTr5Q
@andiwand
andiwand merged commit bbc14ac into main Aug 30, 2026
23 checks passed
@andiwand
andiwand deleted the docs/wasm-readme-edit-diff branch August 30, 2026 07:55
andiwand added a commit that referenced this pull request Aug 30, 2026
`odr.generateDiff()` returns the json already stringified, so the README's
`JSON.stringify` around it handed `edit` a json string where it parses an
object: `json["modifiedText"]` then throws
`[json.exception.type_error.305] cannot use operator[] with a string argument
with string`. Checked against 6.12.0 both ways.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant