Ask what a single note's export should contain, and fix drawings never being in one
Two questions instead of one, because the answers depend on each other: Markdown holds text only, a PNG holds the drawing only, PDF holds both. Listing every format flat would have offered combinations that cannot exist. A note without a drawing skips the first step rather than showing it mostly greyed out. While testing that, the drawings turned out never to have made it into any export at all — not the ZIP, not the PDF. strokeDocOf() *builds* a stroke document from a bare array, and it was being handed one that was already a document, so the strokes ended up nested one level too deep and every length check read undefined. Nothing complained; the export simply came out without the drawing. It went unnoticed because the notes the earlier suite exported had none. Now uses docStrokes(), and the suite draws on a note before exporting it, checks the PNG's magic bytes, and checks it is 159 KB rather than an empty white page — a check on the file merely existing would have passed against the broken version too. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2611d87f8c
commit
8c36c6121b
5 files changed
+284
-57
No files matched your search
@@ -332,7 +332,7 @@ docker compose -f docker-compose.dev.yml up -d --build # must be running
|
||||
| `search-attachments` | 12 | body-only matches, ranking, umlauts; images as blob URLs, not inline bytes |
|
||||
| `history` | 10 | a large deletion is snapshotted, restoring works, restoring is itself undoable |
|
||||
| `drawing` | 7 | strokes survive the poller, and match across four viewport widths |
|
||||
| `export` | 12 | the downloaded bytes are real Markdown and a real ZIP, unpacked and read back |
|
||||
| `export` | 21 | the downloaded bytes are real Markdown, ZIP and PNG, unpacked and read back |
|
||||
|
||||
Each suite creates a throwaway account through the admin API and deletes it
|
||||
afterwards, so runs leave the database as they found it. They need an admin to
|
||||
@@ -485,6 +485,19 @@ Notes should not be hostage to this program, so everything can leave it — from
|
||||
single note up to every note in the account, reachable from the note's toolbar,
|
||||
a notebook's context menu, and Account → *Alle Notizen exportieren*.
|
||||
|
||||
A single note is asked two questions rather than one, because the answers are
|
||||
not independent — Markdown holds text only, a PNG holds the drawing only, and
|
||||
PDF is the one format that holds both:
|
||||
|
||||
| Was soll mit? | In welcher Form? |
|
||||
| --- | --- |
|
||||
| Notiz mit Zeichnung | PDF *(Markdown puts the drawing in a PNG beside it)* |
|
||||
| Nur den Notiztext | PDF · Markdown |
|
||||
| Nur die Zeichnung | PNG · PDF |
|
||||
|
||||
A note without a drawing skips the first question instead of showing it with two
|
||||
thirds greyed out.
|
||||
|
||||
**Markdown** keeps the notes editable elsewhere. Headings, lists, quotes, code,
|
||||
tables and task state all have equivalents and are carried over; a link to
|
||||
another exported note becomes a relative link to its file, and a link to a note
|
||||
|
||||
Reference in new issue
Block a user