Update dependency selectolax to v1 #47
No reviewers
Labels
No labels
montee-majeure
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
foXaCe/wacustom!47
Loading…
Reference in a new issue
No description provided.
Delete branch "renovate/selectolax-1.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
<1.0→<1.1Rattachement atelier : FOXA-18
Release Notes
rushter/selectolax (selectolax)
v1.0.0Compare Source
This release contains breaking changes.
The main change is that the Modest backend is no longer available.
It is outdated and unmaintained, contains bugs, and does not follow modern HTML5 standards.
The second is that
parse_fragment()is gone. It re-implemented fragment parsing by guessingwhether the input was a document or a fragment;
LexborHTMLParser(html, is_fragment=True)alreadydoes this properly, so the guessing layer has been removed.
The rest of the changes fix corner cases where the bugs were happening rarely,
usually when heavily modifying the tree.
selectolax.parseris now a stub that raisesImportErroron import. Use the lexbor backend (
from selectolax.lexbor import LexborHTMLParser) instead.parse_fragment().css_matchesandany_css_matchesmissing matches outside the first top-level node of an HTMLfragment. They now search the same scope as
css.tagsandstrip_tagsdoing nothing on an HTML fragment.tagsreturned an empty list andstrip_tagsremoved nothing, because the fragment was not reachable from the document node.<html>wrapper of an HTML fragment being reported as a match.scripts_containandscript_srcs_containmissing matches outside the first top-levelnode of an HTML fragment. They now search the same scope as
css.scripts_containandscript_srcs_containanswering from another scope's cachedresult. The cache is keyed by the node the search is rooted at rather than the node it was called on.
select()missing matches outside the first top-level node of an HTML fragment.It now searches the same scope as
css.traverse()covering only the first top-level node of an HTML fragment, andyielding nothing when the fragment starts with a text node.
attribute_longer_thanandany_attribute_longer_thanreturning inconsistent resultsattributesandattrsnow report an attribute's qualified name instead of its local name.An element carrying both
hrefandxlink:hrefused to collapse them into a singlehrefkey.iter()skipping the remaining children when a node is removed during iterationLexborHTMLParser('a<span>s</span>', is_fragment=True).text()returned'a'instead of'as'.text()silently returning truncated text instead of raising when a fragment fails to be collected.scripts_containandscript_srcs_containsometimes returning wrong results due to HTML mutations.html,inner_html,html_pretty,attributes,attrs,id,tag,text_lexborandtext_contentraiseUnicodeDecodeError.Bytes Lexbor passes through verbatim are now substituted with U+FFFD, the way
text()already did.text_lexborsometimes holding temporary memory longer than neededmerge_text_nodes(). It is now up to 10 times faster.__eq__attrs.items()andattrs.values().inner_htmlsetter attaching element children to non-element nodesheadandbodydangling after settinginner_htmlon the<html>elementinner_htmlsetter freeing the replaced childrenrootgoing stale on an HTML fragment.fragment, for example by
unwrap().textmethod. Text fragments are now concatenated as raw bytes, up to 5x faster.skip_emptybeing ignored bytext(deep=True)text()raisingUnicodeDecodeErroron undecodable bytes whendeep=False. It now substitutesU+FFFD, like the deep path always did
idmethod on text nodesattrs[key] = valueraisingAttributeErrorinstead ofTypeErrorwhenvalueis not a stringLexborNodeorLexborAttributesdirectly.unwrap()corrupting the tree in some cases.headandbodygoing stale once<head>/<body>is removed from the document.attrsreading freed memory when it outlives the node it was obtained from.attrs[key] = None; it leaked the value buffer header on every call.clone()encoding=TruetoLexborHTMLParser, which detects the encoding ofbytesinput andtranscodes it to UTF-8 before parsing.
Configuration
📅 Schedule: (in timezone Europe/Paris)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.
Fermée : selectolax 1.x retire le backend Modest, et le code importe encore
selectolax.parser.HTMLParser(ImportError à la collecte, porte rouge). Migration lexbor suivie par FOXA-3065. Version épinglée<1.0dans la configuration Renovate (demande #48) pour que la montée ne revienne pas. FOXA-3078.Pull request closed