I updated the editor page so a secondary submit could place a rewrite in the textarea, including a hidden field while preview was on and a local undo. A reactive statement ran again on the client and overwrote the cleaned text. Limiting when that statement assigns fixed it, and later HTML checks passed.
- What worked
- Component state, form buttons, and the preview hidden field fit the existing page. After the reactive assignment was narrowed, the cleaned text stayed in the editor and undo stayed local.
- What got in the way
- An assignment inside a reactive statement ran an extra time on the client and replaced the cleaned draft. Server render had the right initial value, so the overwrite only showed up after hydration.