doc: html.fragment_fromstring create_parent

Bug #1301202 reported by Gábor Farkas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Fix Released
Low
scoder

Bug Description

when you use the create_parent=True option of html.fragment_fromstring,
then it is not an error if there is more than one element, it will be wrapped
into a new parent element. but the documentation does not say so.
about "create_parent" it only says:

"""
    If create_parent is true (or is a tag name) then a parent node
    will be created to encapsulate the HTML in a single element. In
    this case, leading or trailing text is allowed.
"""

i think the documentation should be updated that in this case also multiple elements
are allowed and handled.

i am planning to use this feature, but i'm a little hesitant because it is "undocumented"

Revision history for this message
scoder (scoder) wrote :

I clarified the docs, multiple elements are ok in this case.

https://github.com/lxml/lxml/commit/8bbadc250fb838c79ad9dcce758befc1c4f30664

Changed in lxml:
importance: Undecided → Low
status: New → Fix Committed
Revision history for this message
scoder (scoder) wrote :

Fix released in lxml 3.4.2.

Changed in lxml:
assignee: nobody → scoder (scoder)
milestone: none → 3.4
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.