Skip to content

fix(pages): edit the stored markdown even when editor says wysiwyg - #26

Merged
pnocera merged 1 commit into
pnocera:mainfrom
davidgibbons:fix/markdown-source-over-editor-label
Oct 25, 2026
Merged

pnocera merged 1 commit into
pnocera:mainfrom
davidgibbons:fix/markdown-source-over-editor-label

Conversation

@davidgibbons

Copy link
Copy Markdown
Contributor

Pages created through the BookStack API with a markdown body report editor: "wysiwyg". selectSource trusted that label, so bookstack_pages_edit, bookstack_pages_append and the section tools patched raw_html and wrote html back. BookStack then cleared the page's markdown, and any client that reads that source sees a different page. ha-bookstack-sync, for example, flags every such page as tampered and stops updating it.

A non-empty markdown field now selects the markdown path regardless of editor. BookStack empties markdown whenever html is saved, so a non-empty value is the page's real source. The empty-markdown-page case keeps its existing behaviour. A unit test covers the wysiwyg-labelled markdown page, and all 226 unit tests pass.

Pages created through the API with a markdown body report editor
"wysiwyg". selectSource trusted the label, patched raw_html and wrote
html back, which made BookStack clear the markdown source. Clients that
read that source, such as ha-bookstack-sync, then saw a different page.

A non-empty markdown field now wins, since BookStack empties it whenever
html is saved.
@davidgibbons
davidgibbons force-pushed the fix/markdown-source-over-editor-label branch from ed944d8 to 5e2f38b Compare October 3, 2026 01:01
@pnocera
pnocera merged commit 01d438d into pnocera:main Oct 25, 2026
2 checks passed
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.

2 participants