Repository navigation
v4.0.0
- INCOMPATIBLE CHANGE: Requires Python 3.8 or newer. pip on older Pythons keeps installing 3.0.2.
- FEATURE: Officially support Python 3.10 to 3.15. Python 3.9 and below still work but are no longer tested in CI.
- BUG FIX: Respect UTF-8 and UTF-16 byte order marks when decoding HTML #55.
- BUG FIX: BOM characters (U+FEFF, U+FFFE) inside the text are treated as white-space.
- BUG FIX: Respect UTF-32 byte order marks when decoding HTML #63. A UTF-16 LE document whose first character after the BOM is U+0000 starts with the same bytes, so it is now decoded as UTF-32.
- BUG FIX:
decode_html()witherrors="strict"raisesJustextDecodeError(bothJustextErrorandUnicodeDecodeError) in every branch, not only in the fallback #56. - BUG FIX:
<footer>elements are removed before paragraph extraction, except a<footer>inside<blockquote>holding a quote attribution. - BUG FIX:
<nav>elements are removed before paragraph extraction. - BUG FIX:
<figcaption>starts a new paragraph, so a caption is no longer glued to the text following the<figure>element. - BUG FIX: A paragraph containing the copyright symbol is demoted by one class instead of being rejected outright.
- FEATURE: New parameter
max_good_distance(CLI--max-good-distance) can limit how far, in paragraphs, the context-sensitive classification looks for a good neighbouring paragraph. There is no limit by default, so the whole document is searched as before. - BUG FIX: Context-sensitive classification takes linear time, pages with tens of thousands of short paragraphs no longer take minutes #43.
- INCOMPATIBLE CHANGE: Removed
get_prev_neighbour()andget_next_neighbour()fromjustext.core. They were internal helpers ofrevise_paragraph_classification(). - BUG FIX: Removed Latin-script words (English words, Roman numerals, wiki markup) from the stop-lists of non-Latin-script languages. Serbian is left as is, since it is written in both scripts.
- BUG FIX: Decode
<meta charset>like browsers do, e.g.iso-8859-1aswindows-1252, and bytes undefined inwindows-125xas C1 controls #58. - BUG FIX: Respect the encoding from the XML declaration of XHTML pages, e.g.
<?xml version="1.0" encoding="iso-8859-2"?>#26. - BUG FIX: A short heading close before good text is near-good again during context-sensitive classification, so short blocks around it are kept as documented. Broken since 3.0.0.
Full Changelog: v3.0.2...v4.0.0