mirror of
https://github.com/PerpetualSoftware/pad.git
synced 2026-10-26 22:37:03 +00:00
08a5f1c7d2
* fix(editor): a block marker after a hard break stays text (BUG-3584) prosemirror-markdown escapes a leading -, +, *, >, # or 1. only at a block start, but a hard break starts a new line too, so 'First line' + hard break + '- not a list item' was stored as 'First line\\\n- not a list item' and read back as a paragraph plus a bullet list. PadText treats a line start as a block start for that escape, restoring the flag after. Editor and materializer share PadText (htmlProseExtensions), so parity holds. Claude-Session: https://claude.ai/code/session_01FAVXA5mJ5BNhKmv95jxQkQ * test(materialize): corpus covers block markers after a hard break (BUG-3584) The BUG-3583 corpus block gains lines starting '- ', '# ' and '> ' after hard breaks (one block for both, so adding it did not reshuffle the seeded cases); a vantage probe pins that the corpus reaches the escaped form. corpus.json regenerated; go test ./internal/materialize passes on the rebuilt bundle. Claude-Session: https://claude.ai/code/session_01FAVXA5mJ5BNhKmv95jxQkQ * fix(editor): every block marker after a hard break stays text, and nothing else changes (BUG-3584) The first fix (atBlockStart for the line) missed `1)`, indented bullets, thematic breaks and setext underlines, and escaped markers that open no block. PadText now writes, at any line start, the escaped form of exactly the markers that would open a block (lineStartMarker): a bullet or ordered marker followed by a space/tab/end, `>`, `#{1,6}` followed by a space/tab/ end, or a line of only -, =, _ or *. `#tag`, `-5`, `1.5` keep their form. At a true block start prosemirror-markdown's escape stays in charge except for what it missed (`1)` and an indented bullet/quote, both lists before). Measured against main's serializer over 28 strings at a block start and after a hard break: every difference is one of those bug fixes. Corpus regenerated (the first version's `\-item` escape is gone); go test ./internal/materialize passes on the rebuilt bundle; 22 unit tests. Claude-Session: https://claude.ai/code/session_01FAVXA5mJ5BNhKmv95jxQkQ