Update Beautiful Soup 4.12.2 → 4.12.2 (30c58a1).

This commit is contained in:
JackDandy 2023-10-07 20:56:26 +01:00
parent bf79216b31
commit 0bbbb724a9
3 changed files with 13 additions and 3 deletions

View file

@ -1,4 +1,9 @@
### 3.30.1 (2023-10-02 22:50:00 UTC) ### 3.31.0 (2023-1x-xx xx:xx:00 UTC)
* Update Beautiful Soup 4.12.2 to 4.12.2 (30c58a1)
### 3.30.1 (2023-10-02 22:50:00 UTC)
* Change allow Python 3.12.0 and 3.11.6 * Change allow Python 3.12.0 and 3.11.6

View file

@ -378,10 +378,10 @@ class HTMLParserTreeBuilder(HTMLTreeBuilder):
parser.soup = self.soup parser.soup = self.soup
try: try:
parser.feed(markup) parser.feed(markup)
parser.close()
except AssertionError as e: except AssertionError as e:
# html.parser raises AssertionError in rare cases to # html.parser raises AssertionError in rare cases to
# indicate a fatal problem with the markup, especially # indicate a fatal problem with the markup, especially
# when there's an error in the doctype declaration. # when there's an error in the doctype declaration.
raise ParserRejectedMarkup(e) raise ParserRejectedMarkup(e)
parser.close()
parser.already_closed_empty_element = [] parser.already_closed_empty_element = []

View file

@ -1356,7 +1356,7 @@ class Tag(PageElement):
This is the first step in the deepcopy process. This is the first step in the deepcopy process.
""" """
clone = type(self)( clone = type(self)(
None, self.builder, self.name, self.namespace, None, None, self.name, self.namespace,
self.prefix, self.attrs, is_xml=self._is_xml, self.prefix, self.attrs, is_xml=self._is_xml,
sourceline=self.sourceline, sourcepos=self.sourcepos, sourceline=self.sourceline, sourcepos=self.sourcepos,
can_be_empty_element=self.can_be_empty_element, can_be_empty_element=self.can_be_empty_element,
@ -1845,6 +1845,11 @@ class Tag(PageElement):
return space_before + s + space_after return space_before + s + space_after
def _format_tag(self, eventual_encoding, formatter, opening): def _format_tag(self, eventual_encoding, formatter, opening):
if self.hidden:
# A hidden tag is invisible, although its contents
# are visible.
return ''
# A tag starts with the < character (see below). # A tag starts with the < character (see below).
# Then the / character, if this is a closing tag. # Then the / character, if this is a closing tag.