fix(client): route createPage/createChildPage html through htmlToConfluenceStorage#183
Merged
Merged
Conversation
…luenceStorage createComment and updatePage already normalize HTML input via htmlToConfluenceStorage, but createPage and createChildPage were passing HTML straight to storage. Confluence storage is strict XHTML, so inputs with <br>, <u>, or unclosed tags would be rejected by the server. Bring both create paths in line with the rest of the API surface. The converter is idempotent for storage-quality XHTML (ac:* macros, ri:* references pass through unchanged), so existing callers feeding pre-formed storage via format='html' keep working.
github-actions Bot
pushed a commit
that referenced
this pull request
May 12, 2026
## [2.6.2](v2.6.1...v2.6.2) (2026-05-12) ### Bug Fixes * **client:** route createPage/createChildPage html through htmlToConfluenceStorage ([#183](#183)) ([6946cd7](6946cd7))
|
🎉 This PR is included in version 2.6.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Summary
createCommentandupdatePagealready normalize HTML input viahtmlToConfluenceStorage, butcreatePageandcreateChildPagewere passing HTML straight to storage. Confluence storage is strict XHTML, so inputs with<br>,<u>, or unclosed tags would 422 on the server. Follow-up to #180, which fixed the analogous gap in theconvertcommand.Result: a page created with
--format htmland then updated with the same content no longer mutates between the two calls.Behavior change
Calling
createPage/createChildPagewithformat='html'previously inserted the HTML byte-for-byte. The converter now runs on it, so callers feeding pre-formed storage XHTML will see normalization:<ri:user ri:account-id="…"/><ri:user ri:account-id="…"></ri:user>(self-closing expanded)<ul><li>a</li></ul><ul><li><p>a</p></li></ul>(<p>wrap)<div class="raw">stuff</div>ac:structured-macro ac:name="html"blockupdatePagealready does all of this — so the change just removes a divergence between create and update, not introduces a new transform. The removed// (no macro wrapper)comment marked the previous deliberate bypass; we're dropping it on purpose.Test plan
npm test— 678/678 pass (added 2 regression tests for the html paths increatePage/createChildPage)npm run lint— clean<br>,<u>,<sub>,<img>, empty/whitespace,ac:structured-macro,<ul>/<li>,<table>,<div>— confirmed the transforms above