Skip to content

Commit

Permalink
fix: Add back HtmlProcessingInstruction element
Browse files Browse the repository at this point in the history
closes #28
  • Loading branch information
abelcheung committed Feb 9, 2024
1 parent dcfa02e commit 976da40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions lxml-stubs/html/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ from ._element import (
HtmlComment as HtmlComment,
HtmlElement as HtmlElement,
HtmlEntity as HtmlEntity,
HtmlProcessingInstruction as HtmlProcessingInstruction,
)
from ._form import (
CheckboxGroup as CheckboxGroup,
Expand Down
9 changes: 5 additions & 4 deletions lxml-stubs/html/_element.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,18 @@ class Classes(MutableSet[str]):
#
# Types of other HTML elements
#
# Note that HtmlProcessingInstruction is removed from this world.
# It has never been seen in real life;
# mozilla also explicitly says it won't be supported.
# https://developer.mozilla.org/en-US/docs/Web/API/ProcessingInstruction
# Processing Instruction is only useful for XML in real life;
# it is considered bogus error in HTML spec, but still allowed
# to be constructed in lxml nontheless.
# https://html.spec.whatwg.org/multipage/parsing.html#tag-open-state
#
# HtmlEntity is also rare; it can only appear if a specially constructed
# HTML parser is used. By default entities are merged into text content.
#
# Note the reversed MRO order -- fatal dunders from __ContentOnlyElement
# are dominant in runtime
#
class HtmlProcessingInstruction(etree.PIBase, HtmlElement): ... # type: ignore
class HtmlComment(etree.CommentBase, HtmlElement): ... # type: ignore
class HtmlEntity(etree.EntityBase, HtmlElement): ... # type: ignore

Expand Down

0 comments on commit 976da40

Please sign in to comment.