Skip to content

Releases

v1.16.5

Choose a tag to compare

@github-actions github-actions released this 23 Nov 18:37
Immutable release. Only release title and notes can be modified.

Bug fixes

  • minify_css merges two rules with the same selector when an @media or @supports block it dropped for a later identical copy was the only thing between them. Before, only minifying the output a second time merged them (#2561) by @gaborbernat.
  • minify_js with mangle no longer renames a let, const or class onto the name of an unread top-level var declared in the same loop or block, which wrote a redeclaration and so invalid JavaScript, such as for(const a of x)var a. A regression in 1.16.0 (#2562) by @gaborbernat.
  • Parsing documents with many unclosed elements and stray end tags no longer takes quadratic time (#2564) by @gaborbernat.
  • Resolve absolute XPath expressions from the root of trees built with etree.Element or parsed as single-element fragments with etree.fragment_fromstring (#2560) by @gaborbernat.

🐍 PyPI release

📜 Full Changelog

v1.16.4

Choose a tag to compare

@github-actions github-actions released this 22 Nov 03:05
Immutable release. Only release title and notes can be modified.

Bug fixes

  • An empty lang or xml:lang now marks an element's language as unknown, as HTML specifies, so :lang() no longer inherits an ancestor's language through it: <div lang=en><p lang=""> stopped matching :lang(en). A quoted empty range, :lang(""), matches elements whose language is unknown or never declared, where it matched nothing before. css_to_xpath translates both the same way (#2556) by @gaborbernat.
  • to_markdown with converters keeps */** delimiters on emphasis that ends in punctuation unless a converted element writes right after it. Before, passing any converters made such runs fall back to raw <em> and <strong> tags, even when no converted element was near them (#2557) by @gaborbernat.

🐍 PyPI release

📜 Full Changelog

v1.16.3

Choose a tag to compare

@github-actions github-actions released this 22 Nov 00:21
Immutable release. Only release title and notes can be modified.

Bug fixes

  • turbohtml.etree covers three more lxml.html behaviors: ElementTree.iter iterates from the root element, ElementView.nsmap returns an empty mapping, and to_lxml / to_lxml_html strip characters XML cannot carry from text, tails and attribute values instead of raising ValueError or dropping the attribute (#2552) by @gaborbernat.
  • XPath on a from_lxml() copy resolves absolute paths from a document, as lxml does. The copy was a detached tree, so //h1 inside a predicate searched only below the predicate's context node and /html matched nothing (#2553) by @gaborbernat.
  • turbohtml.etree's document_fromstring, fromstring and fragment_fromstring make a <template>'s content its children, as lxml does, and keep a <template shadowrootmode> as an ordinary template instead of attaching a shadow root. Before, len(), iteration and itertext() on a template saw nothing, and a declarative shadow root's content was missing from text_content() and XPath. strip_elements now reaches template content (#2554) by @gaborbernat.

🐍 PyPI release

📜 Full Changelog

v1.16.2

Choose a tag to compare

@github-actions github-actions released this 21 Nov 22:53
Immutable release. Only release title and notes can be modified.

Bug fixes

  • to_markdown() writes breaks inside emphasis as Markdown hard breaks again when visible text separates them, as in <em>[Image OCR]<br>text<br>[End OCR]</em>, instead of raw <br> tags. Only breaks with nothing visible between them, which would end the paragraph, stay tags (#2551) by @gaborbernat.

🐍 PyPI release

📜 Full Changelog

v1.16.1

Choose a tag to compare

@github-actions github-actions released this 21 Nov 05:39
Immutable release. Only release title and notes can be modified.

Bug fixes

  • rewrite() now raises MemoryError when running out of memory after its first edit, instead of calling the next handler with the error pending, which raised SystemError (#2540) by @gaborbernat.
  • to_markdown() keeps the whitespace of a <pre>, <textarea> or <listing> it writes as raw HTML inside a table cell. The cell's text is folded onto one line, which turned each run of spaces and each line break in such an element into a single space; its line feeds and space runs are now written as character references (#2541) by @gaborbernat.
  • A streaming Tokenizer keeps a long named character reference run in one text token, as tokenize() does, instead of splitting its text once it passed 4096 code points (#2542) by @gaborbernat.
  • minify_css no longer reads memory it never wrote when an allocation fails inside a nested rule's selector or inside a function folded within another function's arguments; it raises MemoryError as everywhere else (#2543) by @gaborbernat.
  • minify_js() raises MemoryError again when an allocation for its scope analysis or fold bookkeeping fails, instead of returning its output (#2544) by @gaborbernat.
  • Text nested past the 512-level depth cap keeps its source order when the adoption agency moves its parent back under the cap: <a>, 500 open elements and eight <div>s followed by <p>y<a>x used to read xy (#2545) by @gaborbernat.
  • A parse that ran out of memory while its open-element stack grew past 64 entries could read past the end of an internal array, and link resolution raised SystemError instead of MemoryError when percent-encoding a link ran out of memory (#2546) by @gaborbernat.
  • The parser keeps the DOM within its documented 512-level cap when the adoption agency moves a subtree, when closing a form or a misnested <a> removes an element from the middle of the open-element stack, and when it copies a selected option into a deep <selectedcontent>: such markup used to nest elements past 512 levels, <form><div></form> repeated 600 times reaching 1019 (#2548) by @gaborbernat.
  • Pickling a node no longer recurses once per tree level. A node pickles as one flat list of its subtree's nodes, so a tree at the 512-level depth cap pickles on Python 3.11, where it raised RecursionError, and in a thread with a small stack, where a tree a few hundred levels deep crashed the interpreter on Python 3.11 to 3.13. The payload is a third smaller and both pickling and unpickling are faster; pickles written by earlier releases still load (#2549) by @gaborbernat.
  • Parsing markup that leaves formatting elements open far down the stack of open elements, such as <i><h1><b><a><s><font><div> repeated, now takes linear time: each formatting tag used to scan the whole stack, so 50,000 repeats took 3.1 seconds instead of 0.25 (#2550) by @gaborbernat.

🐍 PyPI release

📜 Full Changelog

v1.16.0

Choose a tag to compare

@github-actions github-actions released this 20 Nov 23:04
Immutable release. Only release title and notes can be modified.

Features

  • minify_css writes whole millisecond counts as seconds (200ms → .2s), 3D transform functions that fix two axes as their single-axis form (translate3d(0,0,z) → translateZ(z)), and drops an @media or @supports block that an identical later block repeats (#2512) by @gaborbernat.

Changes

  • minify() writes text and attribute values in the shortest form that reparses to the same tree. & stays literal where it cannot start a reference, > and U+00A0 stay literal in text, an attribute value takes whichever quote it holds fewer of, and a value ending in / or holding a literal & drops its quotes. Pages come out 0.3-1.3% smaller in 0.6-2.8% fewer instructions (#2511) by @gaborbernat.
  • minify_css() merges rules across a /*! ... */ bang comment between them and writes the comment after the merged rule. A comment takes no part in the cascade, so a{color:red}/*!k*/b{color:red} → a,b{color:red}/*!k*/. A stylesheet of 200 identical rules split by bang comments comes out 41% smaller (#2535) by @gaborbernat.
  • minify_css() writes transform-origin and perspective-origin keywords as offsets, drops a zero z offset, writes a centered position as top or bottom, drops ease from a transition layer that names its property first, and drops the initial outside and disc from list-style. animate.css comes out 212 bytes smaller and foundation.css 121 bytes (#2537) by @gaborbernat.

Bug fixes

  • RELAX NG validation no longer raises ValueError as too ambiguous for a valid document with repeated blocks of optional elements, and checking a block takes time in proportion to the elements it holds (#2448) by @gaborbernat. (#2382)
  • XPath predicates that select the nearest node with [1] before another predicate, such as ancestor::b[1][@x], no longer slow down quadratically on long documents; results are unchanged (#2446) by @gaborbernat. (#2444)
  • Range boundaries now follow the DOM live-range rules through normalize() and whitespace collapse. A boundary on a parent element at a text node that normalize() merges moves into the merged text, and a boundary past whitespace that the collapse drops shifts with the text, so compare_point() matches the text again (#2447) by @gaborbernat. (#2445)
  • Element.after() in rewrite() on an unclosed raw-text element, such as a <script> or <style> with no end tag, now writes its text unescaped, so it reads back as written and a carriage return is written as a line feed. Text that would end the element early raises ValueError, as it does for append(); html=True content is written as given, as it is for append() (#2450) by @gaborbernat. (#2449)
  • encode() now refuses U+000E, U+000F and U+001B under a stateful codec whatever its name, including one that cannot encode the sample characters the probe used before. Such a codec wrote the raw byte, which a decoder reads as a shift, so the markup could read back with a different meaning. tostring() writes the character as a reference, as it does for the ISO-2022 codecs (#2454) by @gaborbernat. (#2453)
  • Encoding detection now agrees with chardetng on input that starts with an ASCII run followed by a non-ASCII byte. Such input could land on another single-byte encoding: b"a1111\xaa " detected as ISO-8859-4 where chardetng says windows-1252. The confidence reported for some of these inputs changes too, so with a threshold such input can now detect an encoding where it returned None (#2473) by @gaborbernat.
  • Encoding detection keeps GBK in the running when a four-byte GB18030 sequence ends in a 0xFF byte, or in an ASCII byte after a 0xA0 or 0xFE byte, as chardetng does. A stream such as b"\xe26\x90\xff0\xa3\x89" with a .cn hint now detects as GBK instead of IBM866 (#2487) by @gaborbernat.
  • Encoding detection no longer scores the ASCII byte that follows an unmapped Big5 character as a letter, as chardetng does. Some streams that hold such a pair now detect as Big5 instead of windows-1252 (#2488) by @gaborbernat.
  • On 32-bit builds, minifying a very large stylesheet or script, or escaping a very long identifier, now raises MemoryError instead of letting a buffer size wrap around and writing past the allocation (#2493) by @gaborbernat.
  • rewrite() no longer raises ValueError when Element.after() adds text to an unclosed <script> whose input already holds a <!--. Text that would end the element early still raises ValueError (#2497) by @gaborbernat.
  • Writing a document with meta_charset=True no longer refuses text the declared encoding can represent: the bytes now come from the WHATWG encoder the <meta charset> names, and only a character with no byte in that encoding is refused (#2499) by @gaborbernat.
  • On a free-threaded build, appending an element that holds wrapped descendants into another tree no longer crashes when another thread moves one of those descendants at the same time. Releasing the old tree's references during the move could let the other thread change the subtree being walked (#2523) by @gaborbernat.
  • minify_js() folds integer arithmetic over literals with _ separators. 1_0+1 printed as 10+1, which a second minification then folded to 11, so minifying the output again changed it (#2529) by @gaborbernat.
  • minify_js() keeps a read or write of a let, const or class binding that can run before the declaration initializes it, since that access throws a ReferenceError. It dropped x=2 from x=2;let x=1 and the read of x from y=x with y unused, also when the access sat in a hoisted function called early or after a skipped switch case (#2526) by @gaborbernat.
  • minify_js() keeps assignments to top-level bindings. It dropped x=2 from var x=1;x=2 when the script never read x again, but a top-level binding is a global that another script on the page can read (#2525) by @gaborbernat.
  • minify_js() keeps the name of an outer binding that a block function inside a same-named catch clause shadows. Annex B hoists such a function to a var of the enclosing function, but only the catch parameter kept its name, so in function g(){try{}catch(g){{function g(){}}}return typeof g} the renamed self-name changed typeof g from "undefined" to "function" (#2527) by @gaborbernat.
  • minify_js() no longer folds arithmetic over a legacy octal literal as if it were decimal: 010*2 became 20 where it evaluates to 16 (#2528) by @gaborbernat.
  • minify_js() no longer inlines a function declaration into the body of a while or do-while loop written without braces, where the function was created again on every iteration. A block the output prints without braces also resolves its names as the output parses, so minifying the output again changes it in fewer cases (#2524) by @gaborbernat.
  • minify_js() weighs a number literal by the spelling it prints, not the one in the source, when deciding whether to copy it into every read. const h=3600000 read twice now inlines as 36e5 in one pass; before, the second minification inlined it, so minifying the output again changed it (#2531) by @gaborbernat.
  • parse() again reports unexpected-null-character for a NUL inside a long run of plain Latin-1 text on x86-64. It dropped that error, while a streamed parse of the same string reported it (#2467) by @gaborbernat.

Performance

  • Parsing XML no longer copies plain attribute values twice: a value with no reference and no whitespace to normalize is written straight into the tree, cutting the parse of a document with a 100k-character attribute value about fourfold (#2464) by @gaborbernat.
  • Building elements with Element(...) and E.<tag>(...) from plain dicts runs faster: the mapping check skips the abstract base class and short attribute names are lowercased without a heap allocation (#2469) by @gaborbernat.
  • Encoding detection skips over long runs of ASCII in each candidate encoding instead of scoring them byte by byte, so detecting a mostly ASCII document with a legacy encoding takes much less time (#2470) by @gaborbernat.
  • Encoding detection returns sooner when a byte-order mark or a <meta> declaration decides the answer, both for a one-shot call and f...
Read more

v1.15.12

Choose a tag to compare

@github-actions github-actions released this 17 Nov 15:17
Immutable release. Only release title and notes can be modified.

Bug fixes

  • Base URL, meta refresh and link extraction now skip <base> and refresh <meta> inside <template>, and SVG or MathML base and meta elements, as browsers do (#2231) by @gaborbernat. (#1685)
  • XSD range facets now follow XML Schema for NaN bounds, including list items, and for long decimal and integer values that rounding used to misjudge (#2242) by @gaborbernat. (#1736)
  • to_markdown() drops comments from tables and lists nested in pipe-table cells, where a comment ending in a dash used to show as visible text (#2226) by @gaborbernat. (#2223)
  • Inserting or replacing HTML inside a MathML annotation-xml with an HTML encoding now creates HTML elements, and sanitizing MathML children placed there escapes them (#2229) by @gaborbernat. (#2228)
  • XSD length, minLength, maxLength, totalDigits and fractionDigits facets now apply their limits exactly, where large limits used to be distorted (#2247) by @gaborbernat. (#2232)
  • Content added with prepend() or append() now stays in place when a rewrite handler unwraps the element with remove_and_keep_content() (#2248) by @gaborbernat. (#2233)
  • minify_css() keeps a string's value when a line continuation follows a hex escape, instead of joining the escape to the next character (#2241) by @gaborbernat. (#2234)
  • Sanitizing a kept <style> whose last declaration has an unclosed parenthesis no longer appends another ;} on each pass, so re-sanitizing the output returns it unchanged (#2251) by @gaborbernat. (#2235)
  • Refresh <meta> content on XML input is now scheme-checked whatever the case or order of its http-equiv attributes (#2261) by @gaborbernat. (#2237)
  • Non-ASCII list bullets, emphasis and strong wrappers, and the to_text() cell separator and default image alt are now written as given instead of as mojibake (#2239) by @gaborbernat. (#2238)
  • minify_js() accepts get, set and async as shorthand names with a default value in destructuring patterns instead of raising an error (#2243) by @gaborbernat. (#2240)
  • The strict language filter now judges a subdomain language on the host a browser opens, so every spelling of one host gets the same result (#2273) by @gaborbernat. (#2244)
  • Escape the text of a raw-text node such as style or xmp when linkify returns it as a string (#2249) by @gaborbernat. (#2245)
  • Node.resolve_links() now resolves a link with a different special scheme and extra slashes before its host, such as ftp:///example.com/p, to the host it names (#2268) by @gaborbernat. (#2250)
  • XSD xs:any and xs:anyAttribute wildcards now match the elements and attributes their namespace, occurrence and processing settings admit, so validation verdicts follow them (#2256) by @gaborbernat. (#2252)
  • Compiling an XSD schema now raises ValueError for a group in a content model that has no ref attribute, instead of accepting it (#2258) by @gaborbernat. (#2253)
  • XSLT literal result elements now honor their own xsl:exclude-result-prefixes attribute, so excluded namespace declarations are no longer copied to the output (#2259) by @gaborbernat. (#2254)
  • A carriage return in script, style or other raw-text content is now written as a line feed, and rewritten text writes it as &#13; (#2284) by @gaborbernat. (#2255)
  • minify_js() folds long chains of string literals joined with + in time that grows linearly with the chain's length (#2264) by @gaborbernat. (#2257)
  • :has() with child or sibling combinators in its argument no longer slows quadratically on deeply nested documents (#2271) by @gaborbernat. (#2262)
  • Attribute names with a lone surrogate are now returned as parsed (#2265) by @gaborbernat. (#2263)
  • A label passed as encoding= that contains a NUL byte now raises LookupError, and the error shows the whole label (#2274) by @gaborbernat. (#2269)
  • minify_js() raises an error for a string, template or regex token where a property name must be, such as after . or as a template key (#2275) by @gaborbernat. (#2270)
  • Node.encode with meta_charset now raises ValueError when the encoded bytes would read back as different text under the declared encoding, instead of writing them (#2282) by @gaborbernat. (#2276)
  • Node.resolve_links() now resolves a special-scheme link written without slashes before its host, and reads a backslash as a path separator, as a browser does (#2295) by @gaborbernat. (#2277)
  • Range facets on xs:gYear, xs:gYearMonth, xs:gMonth, xs:gMonthDay and xs:gDay now reject values outside their bounds (#2279) by @gaborbernat. (#2278)
  • Schemas with a top-level group, complex type, simple type, attribute or attribute group that has no name now fail to compile with ValueError (#2281) by @gaborbernat. (#2280)
  • Streaming parsers no longer buffer unfinished character references beyond their output: long named runs and numeric digits leave the input as they arrive (#2294) by @gaborbernat. (#2283)
  • minify_js() keeps input that ends right after a member dot unchanged, as it did before the literal-token check, instead of raising an error (#2287) by @gaborbernat. (#2285)
  • Converting HTML to Markdown no longer takes quadratic time on a run of digits followed by elements that write no Markdown (#2296) by @gaborbernat. (#2286)
  • XPath predicates that look at ancestor, sibling, preceding or following nodes no longer slow down quadratically on long documents; results are unchanged (#2314) by @gaborbernat. (#2288)
  • RELAX NG schemas that nest group pairs of optional elements now accept valid documents instead of raising ValueError as too ambiguous (#2326) by @gaborbernat. (#2290)
  • XSD validation now checks prefixed attributes against declarations and wildcards by namespace, so anyAttribute namespace and processContents settings apply to them. Undeclared xml: attributes are now reported (#2330) by @gaborbernat. (#2291)
  • A live Range now moves its boundaries when text is replaced, deleted, split or normalized and when nodes are removed or inserted, so offsets and comparisons stay correct (#2323) by @gaborbernat. (#2292)
  • Serializing markup under an ISO-2022 codec registered under another name now refuses U+000E, U+000F and U+001B, as the built-in ISO-2022 codecs do (#2315) by @gaborbernat. (#2305)
  • A carriage return in an attribute value written by rewrite() is now written as &#13;, and in a comment as a line feed, so the outpu...
Read more

v1.15.11

Choose a tag to compare

@github-actions github-actions released this 16 Nov 01:02
Immutable release. Only release title and notes can be modified.

Bug fixes

  • Prevent phone-number extensions with many separators from writing past the recognizer's chunk buffer. Preserve XML comment boundaries after invalid controls are removed and exact carriage returns and line feeds in CLI text files. Deeply nested XPath expressions now raise XPathDepthError during parsing, matching evaluation (#1675) by @gaborbernat.
  • Element.insert() and ElementView.insert() no longer slow down with the number of siblings when inserting near either end of a long child list (#2150) by @gaborbernat. (#1695)
  • After a handler edit, rewrite writes the markup that follows, and a < the edit left before it, so a browser reads them as it read the input (#2146) by @gaborbernat. (#1701)
  • XML Schema validation now rejects child elements in an element declared with an inline xs:simpleType, as it already does for a type= declaration (#2127) by @gaborbernat. (#1708)
  • Reading or clearing every attribute of an element with many attributes, or removing them by name from either end, now takes time linear in the attribute count (#2174) by @gaborbernat. (#1709)
  • Multi-step XSD extensions now require every base type's content, so complete documents are accepted and incomplete ones rejected; invalid xs:all extensions now raise (#2135) by @gaborbernat. (#1716)
  • Keep computed_style fast on deeply nested documents in any call order, instead of restyling every ancestor on each call (#2181) by @gaborbernat. (#1718)
  • Sanitizer checks now judge each value as the XML serializer writes it too, so dropped control characters can no longer rejoin CSS, URLs, or template markers the checks refused (#2116) by @gaborbernat. (#1728)
  • Minified CSS keeps the separator after a name ending in an escaped character, so the output parses as the input did (#2161) by @gaborbernat. (#1729)
  • Read <meta http-equiv=refresh> targets as browsers do, so links(), rewrite_links(), resolve_links() and meta_refresh() agree, and text right after the delay is no redirect (#2126) by @gaborbernat. (#1737)
  • A loop of Range calls over the children of one wide element no longer slows down with the square of the child count (#2144) by @gaborbernat. (#1743)
  • minify_css no longer brings to life an @import, @namespace, @charset or @layer statement that browsers ignore, and keeps an empty rule that holds one back (#2145) by @gaborbernat. (#1745)
  • XPath regex searches with back-references now count every capture group against the step limit, so such patterns raise ValueError instead of running past it (#2131) by @gaborbernat. (#1746)
  • XPath expressions that nest predicates or operators around matches(), replace() or extension functions no longer slow down with each level of nesting (#2179) by @gaborbernat. (#1748)
  • rewrite() no longer adds a tag where an empty end tag or removed node sat between a < and text, including raw text past the nesting cap (#2195) by @gaborbernat. (#1752)
  • Keep the doctype's public and system identifiers and forced quirks mode in to_source, so the output reparses in the source's document mode (#2141) by @gaborbernat. (#1757)
  • rewrite() no longer lets a removed <script> through on pages nested past 8,192 open elements; edits it cannot apply there raise ValueError (#2196) by @gaborbernat. (#1758)
  • Link extraction, rewriting and sanitizing now read srcset candidates like a browser: commas inside parentheses no longer split a candidate, and candidates with invalid descriptors are skipped (#2148) by @gaborbernat. (#1759)
  • Repeatedly assigning Text.data, Comment.data or the etree text and tail properties now keeps memory proportional to the current text instead of every value assigned (#2133) by @gaborbernat. (#1760)
  • Minifying a style attribute now drops the rest of a declaration broken by a {} block or a stray }, rather than letting it apply (#2151) by @gaborbernat. (#1763)
  • XML Schema and RELAX NG range facets now judge the whole of a long numeric value instead of a truncated prefix of it (#2164) by @gaborbernat. (#1764)
  • xs:list and xs:union values are now checked against their item or member types, including xs:NMTOKENS, xs:IDREFS and xs:ENTITIES, instead of accepting any text (#2147) by @gaborbernat. (#1765)
  • Style attributes and <style> bodies no longer keep properties outside css_properties that browsers apply, and drop declarations containing a unicode-range token (#2137) by @gaborbernat. (#1768)
  • Edits that leave <style> elements alone no longer make computed_style recompile every sheet, and changes to a style's type or text apply at once (#2166) by @gaborbernat. (#1770)
  • A code block whose language contains a backtick is now fenced without that language, so its text stays code instead of being read as Markdown (#2153) by @gaborbernat. (#1771)
  • Serialized and minified HTML no longer lets a script run past its end tag and turn later content into live markup (#2173) by @gaborbernat. (#1773)
  • Long <meta> charset values are read in full, so padded labels resolve, and a charset that names no encoding no longer hides a content declaration, as in browsers (#2155) by @gaborbernat. (#1775)
  • minify output now reads the same in browsers that run scripts: <noscript> content is copied from the source, and a page whose <noscript> content parses differently there keeps everything after it unminified (#2154) by @gaborbernat. (#1776)
  • XPath function calls with many arguments now run in linear time when the expression uses regex or extension functions (#2156) by @gaborbernat. (#1778)
  • minify_css keeps the separators that a unicode-range start, an unclosed calc() or a universal selector needs, and stops crashing on some bang comments (#2198) by @gaborbernat. (#1835)
  • minify_css keeps a hash color that contains a CSS escape as written instead of shortening it, so the escape no longer swallows the closing brace of its rule (#2191) by @gaborbernat. (#1849)
  • minify_css keeps a rule whose selector starts with a combinator, such as > or ~, rather than dropping it or merging it into the rule before (#2192) by @gaborbernat. (#1850)
  • CSS minification now keeps a selector with three or more colons as written, and minifying the output again changes nothing (#2200) by @gaborbernat. (#1851)
  • Minified CSS no longer glues a calc()-unwrapped value to the token after it, and a calc() group left open at end of input folds in one pass (#2197) by @gaborbernat. (#1852)
  • Minifying CSS with stray brackets, hex escapes or CDO/CD...
Read more

v1.15.10

Choose a tag to compare

@github-actions github-actions released this 07 Nov 06:17
Immutable release. Only release title and notes can be modified.

Bug fixes

  • Avoid false encoding fuzz failures when html5lib keeps an unmatched paragraph end tag inside foreign content (#1659) by @gaborbernat.
  • Keep emphasis continuous across paragraphs flattened into a Markdown table cell (#1663) by @gaborbernat.
  • Keep emphasis runs separate across blocks flattened into Markdown table cells (#1658) by @gaborbernat.
  • Preserve line breaks in HTML attribute values inside Markdown table cells (#1661) by @gaborbernat.
  • Preserve nested emphasis across block boundaries in HTML-to-Markdown conversion (#1660) by @gaborbernat.
  • Skip unsupported CSS shorthand values in the stylesheet fuzz oracle (#1657) by @gaborbernat.

🐍 PyPI release

📜 Full Changelog

v1.15.9

Choose a tag to compare

@github-actions github-actions released this 06 Nov 23:00
Immutable release. Only release title and notes can be modified.

Bug fixes

  • Keep one-shot and streaming encoding detection consistent when an unmapped byte disqualifies the logical Hebrew candidate. Both now use the same punctuation tiebreak to select the encoding (#1637) by @gaborbernat.
  • Avoid a MemoryError and emit balanced CSS when an unterminated function reaches the nesting limit (#1641) by @gaborbernat.
  • Keep XML comments well formed when invalid characters follow or separate hyphens (#1649) by @gaborbernat.
  • Keep malformed CSS math functions stable when their raw fallback ends inside a nested function (#1645) by @gaborbernat.
  • Keep the encoded-text fuzz check aligned with current HTML select parsing when style or title content appears inside select (#1640) by @gaborbernat.
  • Normalize leading whitespace in XML processing instruction data so the serialized output remains stable when reparsed (#1648) by @gaborbernat.
  • Omit hidden elements from Markdown code blocks and spans (#1644) by @gaborbernat.
  • Omit invalid namespace declarations when serializing HTML as XML, so the output parses as XML (#1643) by @gaborbernat.
  • Preserve carriage returns in HTML nested inside Markdown table cells (#1652) by @gaborbernat.
  • Preserve declaration boundaries when a CSS value ends in an unpaired backslash (#1647) by @gaborbernat.
  • Preserve emphasis on the cells of irregular tables exported as raw HTML in Markdown (#1638) by @gaborbernat.
  • Preserve repeated spaces in image attributes when rendering Markdown tables (#1646) by @gaborbernat.
  • Preserve token separators after hex escapes in CSS function arguments (#1651) by @gaborbernat.
  • Recognize character references for control whitespace in Markdown fuzz checks (#1650) by @gaborbernat.

🐍 PyPI release

📜 Full Changelog