Commit Graph
13 Commits
Author SHA1 Message Date
autocraft-bot[bot] 1ae27ae040 Merge pull request #1664 2026-11-29 00:14:29 +00:00
autocraft-bot[bot] adb496e08a Merge pull request #1415 2026-11-29 00:14:27 +00:00
FredApps 8b17a649d2 Merge branch 'main' into port/odt-list-item-paragraphs 2026-11-26 10:18:16 +01:00
aiongg 53ac626a31 next CI: derive Preview's Default, restore flatten_write's Cyan ink and main's craft-zip README line, gate the embedded-SVG test on tree, fix doc links
- craft-behavior: Preview<V> derives Default with #[default] Unchanged (clippy::derivable_impls on Rust 1.100).
- craft-prepress tests/flatten_write.rs: main's even-odd test needs the Cyan ink const.
- craft-svg: the embedded-SVG scene test needs the data-URL image resolver, which is behind feature tree.
- Docs: no links to private items (markdown, dwg, ui-patterns), no link to a crate that is not a dependency (frame), write() for the function (doc-binary), an autolink for the URL (update), Self::from_bytes (psd). craft-midi's source_timed and craft-pdf's cos::content keep only their inner docs, so their links resolve inside the module.
- README: main's craft-zip entry with its lenient reader sentence, lost in the 17 Nov merge.
2026-11-17 14:28:37 +00:00
alehel f988a285dc Merge remote-tracking branch 'origin/main' into r1754-merge 2026-11-17 09:30:15 +01:00
Dylan M. Taylor fbb3f47f7a craft-markdown: share extracted-text paragraphs and pipe-table writer (#1981) 2026-11-16 22:24:56 -05:00
alehelandClaude Opus 5.5 e994f6ce33 flow: a heading in a list item stays in its item
A text:h inside a text:list-item is read as one of the item's further
paragraphs, but continues_list accepted only plain paragraphs, so the
HTML, Markdown and ODT writers ended the list at the heading and the
numbering restarted after it.

continues_list now also accepts headings. HTML writes the heading tag
inside the li, ODT writes a text:h inside the text:list-item, and
Markdown writes the ATX heading indented under the item. Quotes, code
and other kinds still end the list, as the writers cannot put them in
an item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 19:36:36 +01:00
alehelandClaude Opus 5.5 9b94448103 List item further paragraphs: fixes from review
- flow: each piece of a further paragraph split at a page break keeps its item.
- flow: body text resets the per-level item text positions, so a list starting with a
  header after an earlier, further-indented list keeps the header in its list.
- flow: a further paragraph in a table-style-formatted cell keeps its list_item marker.
- html: a further paragraph is written through para_html, keeping alignment and page break.
- markdown: a quoted list item's further paragraph joins the item with a line break, so the
  quoted list stays one list and keeps its numbers.
- odf: a further paragraph opening or closing a kept section ends the list run, as an item does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:44:17 +01:00
alehelandClaude Opus 5.5 9c27cebc14 ODT: a list item's further paragraphs stay paragraphs
LibreOffice writes an unnumbered list entry as an item's second paragraph.
The ODT reader joined it to the first with a line break, so a save could
bring the file back with the wrong paragraphs, and a list header got a
number. Such paragraphs are now read as paragraphs of their own, with no
number, at the item's text indent, and marked with the new
`ParaProps::list_item` (the flow model's `Para::item`).

- HTML and Markdown export keep the paragraph in its item, so one numbered
  list continues across it.
- Markdown `parse_list` joins a code block, quote or heading inside an item
  back to the item (also after a sublist), so it gets no number.
- The writers keep a paragraph in its item only while it sits at the item's
  text indent, so text outdented to the margin leaves the list.
- ODT written from the model puts a further paragraph inside its
  `text:list-item`.
- A level first used after an unnumbered paragraph keeps the file's label.

Ported from storytold/wordcraft#5723 after the readers and writers moved here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 21:57:23 +01:00
beeraw c7bedac14f craft-markdown: an <a …> tag checks only the next four bytes for its </a> (wordcraft#3715)
Each <a …> tag lower-cased a copy of the rest of its paragraph to look for </a>, which is quadratic on a paragraph of tags. Compare the next four bytes with eq_ignore_ascii_case instead; str::get returns None off a character boundary, so a multi-byte character there fails the match without panicking. Port of storytold/wordcraft#4263.
2026-11-15 20:22:35 +03:00
Mex b6fb8bde71 test(markdown): cover numeric reference digit boundaries 2026-11-14 23:31:50 +01:00
Mex e1167c4b1b fix(markdown): preserve oversized numeric references as literal text 2026-11-14 23:30:42 +01:00
Dylan M. Taylor 1e3d3968c1 Add craft-markdown: Markdown read and written, on craft-flow (stacked on #1025) (#1030)
* Add craft-wordmodel: WordCraft's document model without its editing code

WordCraft's crates/doc (wordcraft-doc, at 07f97737) moved as it is, so the DOCX,
RTF, ODT and other text-format crates can read into and write from one model.
Module paths, type names and serde attributes are unchanged: an app that
re-exports the crate keeps its native file format.

Left in the app: range editing (edit.rs), IME text and equation editing. Not
model, and already in craft-libs: code pages (craft-rtf), the ZIP entry-count
check (craft-opc), the compound-file guard (craft-cfb). The paragraph walks
moved to walk.rs and the unit helpers of wordcraft-geom to geom.rs.

* craft-wordmodel: math_tree, the arguments of an equation node and a walk over its runs

The DOCX reader and writer walk an equation's runs. The walk and the child
accessors it uses were in WordCraft's equation editor (math_edit.rs), which
stays in the app; they are structure, not editing.

* craft-wordmodel: keep the document operations (edit.rs) with the model

The DOCX and RTF readers use them: alternative-format chunks are merged into
a document with adopt_blocks, and a reader formats ranges with format_range
and inserts objects. They operate on the document, not on a view, so they
belong beside it. The tests that drove them come back with them; the
paragraph walks stay in walk.rs and edit re-exports them.

base64 0.23, as WordCraft and craft-offcrypto use.

* Add craft-flow: the flow model the text formats map to, on craft-wordmodel

WordCraft's crates/formats/src/model (07f97737) moved as it is: Flow,
FBlock, Para, Inline, Fmt, tables and cells, pictures, to_doc and
from_doc, picture sniffing, colours, base64 and the Dropped report. Only
the paths changed (wordcraft_doc is craft_wordmodel); the report helpers
are public so the format crates can call them; the image re-encoding
helper stays with WordCraft's RTF writer.

* Add craft-markdown: Markdown read and written, on craft-flow

WordCraft's crates/formats/src/markdown (07f97737) with its 35 tests,
moved onto craft-flow and craft-wordmodel. Character references come from
craft-html. The table cell budget lives in craft-flow, which names it in
its warning. Two test lines that wrote plain text through WordCraft's txt
module stay in WordCraft.
2026-11-11 20:46:15 -05:00