Skip to content

Static Site Editor initial non-mode switch saving bug

Summary

  • The issue is that on initial edit in WYSIWYG mode WITHOUT changing to Markdown mode results in an editable that has an updated body, but not an updated raw.
  • Then the Object.assign below, the old raw gets used in the parse and thus the body update is never reflected.
  • This is a non-issue when an initial Markdown mode change occurs as syncRaw will get called which leverages the recently updated body so all is well.
  • This issue actually happens in the opposite direction (Markdown mode) too if you were to go to it initially, make an edit, and then save while staying in Markdown mode

Steps to reproduce

  1. Use static site editor
  2. Make edit in initial WYSIWYG mode
  3. Save

Bug: syncing never happens and the saved raw (with front matter) vs. body (no frontmatter) doesn't account for the body changes.

Edited by Derek Knox