The toolbar and writing area share one iframe. The library stays unchanged:
its normal, synchronous init() runs inside that document.
Inline editor and split-pane preview
Loading the editor…
Loading a sample replaces the document, not a native undo step.
Type in the editor, then in the note, and try the editor's Undo. Cross-document focus and history routing depend on the browser/runtime. Linux WebKit can undo the note instead, even across frames. Some automated Firefox runtimes also misroute parent/child input. Check your target browser before relying on iframe history isolation.
Parent code waits for the frame to load before calling its API. The
markdownchange event is example glue, not a library event.
This same-origin frame is not a security sandbox or a cross-browser history guarantee. All
assets stay local. The static template below contains no user Markdown;
document text goes through setMarkdown(), never into srcdoc.