Files
AFFiNE/packages/frontend/native
keepClamDown 761bbd3bc6 fix(native): handle more hand-written markdown in disk sync (#15616)
## Description

Disk Markdown sync could not reliably sync Markdown files written
outside AFFiNE:

- A file containing a table failed to import (`invalid_projection`),
because the table is an opaque block that the merge only accepts as a
block marker. Unchanged opaque blocks are now matched through the
checkpointed file body and passed to the merge as markers. Edits to an
opaque block are still rejected.
- Changes the Markdown source cannot carry, such as the collapsed state
the editor sets on blocks, produced a review candidate for a
hand-written file. They now leave the checkpointed file as it is.
- Frontmatter: an empty block (`---` followed by `---`) and a closing
delimiter at the end of the file were read as body text, YAML escapes
such as `é` were kept literally, and keys AFFiNE does not sync (for
example `aliases:`) were dropped on export. Unknown lines are now kept
verbatim.
- File names for non-ASCII titles fell back to `doc`.
- The temporary file used while creating a Markdown file had a `.md`
extension, so a leftover one was imported as a document.

## Verification

- `cargo test -p affine_native --lib disk_sync`
- `cargo clippy -p affine_native --all-targets --all-features -- -D
warnings`
- `rustfmt +nightly --check` on the changed files
2026-11-23 22:55:03 +08:00
..
2025-02-25 06:51:56 +00:00