diff --git a/.changeset/md-core-converter.md b/.changeset/md-core-converter.md new file mode 100644 index 0000000..2f479a8 --- /dev/null +++ b/.changeset/md-core-converter.md @@ -0,0 +1,5 @@ +--- +'@affordances/md': patch +--- + +Converts about 5× faster; the markdown is unchanged. Malformed HTML, and a few unusual placements (a form inside a link, strikethrough or table cell, a comment or script inside a ``, a React streamed boundary that moves through an `` or into its own segment, an AgentMain inside a link that also holds tabs, form values or empty blocks, a slot inside a form control or an element other than plain containers, headings, emphasis, code, table cells, buttons, labels, summaries, forms and links, or in a link that holds a value or says nothing but values, a shown tab panel whose tab is inside a link or table, or tabs whose only shown panel is under a hidden element), can convert slightly slower. diff --git a/.changeset/md-deep-nesting.md b/.changeset/md-deep-nesting.md new file mode 100644 index 0000000..67e187f --- /dev/null +++ b/.changeset/md-deep-nesting.md @@ -0,0 +1,5 @@ +--- +'@affordances/md': patch +--- + +A page nested thousands of elements deep no longer throws or takes minutes to convert. `htmlToMarkdown`, `readPage` and the route read anything nested more than 128 elements deep as its plain text, and a page nested more than 512 deep up to there. When either leaves something out, `readPage` and `htmlToMarkdown` say `cut: true`, and the route marks the page `x-affordances-md-partial`, with a note in the Markdown. An error md didn't foresee no longer decides a page alone: when the faster converter throws, the page is converted the original way, and `readPage` never throws. If md can't convert a page at all, `markdown()` and `htmlToMarkdown` throw that error, and the route answers `502`, `private, no-store`, as it does for Flight data it can't read, instead of the framework's generic `500`. diff --git a/.changeset/md-faster-conversion.md b/.changeset/md-faster-conversion.md new file mode 100644 index 0000000..e0d8931 --- /dev/null +++ b/.changeset/md-faster-conversion.md @@ -0,0 +1,9 @@ +--- +'@affordances/md': patch +--- + +Converting a page to markdown takes about half the time, and far less on some pages. The markdown is the same. + +- The html is parsed without each node's place in the source. Nothing read it, and on a page of many lines working it out took longer than everything else together. +- The tree is no longer structured-cloned before it's converted, and its whitespace is collapsed without rebuilding the tag tests for every node. +- A page's chrome and its shown tab panels are found by reading each element's properties rather than with css selectors over the whole page. diff --git a/.changeset/md-flight-placeholder.md b/.changeset/md-flight-placeholder.md new file mode 100644 index 0000000..25589bc --- /dev/null +++ b/.changeset/md-flight-placeholder.md @@ -0,0 +1,5 @@ +--- +'@affordances/md': patch +--- + +A Flight push in a JSON-LD script, or in a script inside a MathML ``, no longer leaves an internal placeholder in the Markdown: it reads as the page does without its Flight data. diff --git a/.changeset/md-flight-unrun-scripts.md b/.changeset/md-flight-unrun-scripts.md new file mode 100644 index 0000000..72d7b8f --- /dev/null +++ b/.changeset/md-flight-unrun-scripts.md @@ -0,0 +1,5 @@ +--- +'@affordances/md': patch +--- + +A Flight script or a streamed boundary's instruction inside a `