Skip to content

Commit fa5171c

Browse files
committed
Fix return types for inner_html
1 parent ccfcf70 commit fa5171c

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

selectolax/lexbor.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class LexborSelector:
7272
...
7373

7474
@property
75-
def inner_html(self) -> str:
75+
def inner_html(self) -> str | None:
7676
"""Return HTML representation of the child nodes.
7777
7878
Works similar to innerHTML in JavaScript.
@@ -81,7 +81,7 @@ class LexborSelector:
8181
8282
Returns
8383
-------
84-
text : str
84+
text : str or None
8585
"""
8686
...
8787

@@ -637,7 +637,7 @@ class LexborNode:
637637
...
638638

639639
@property
640-
def inner_html(self) -> str:
640+
def inner_html(self) -> str | None:
641641
"""Return HTML representation of the child nodes.
642642
643643
Works similar to innerHTML in JavaScript.
@@ -646,7 +646,7 @@ class LexborNode:
646646
647647
Returns
648648
-------
649-
text : str
649+
text : str or None
650650
"""
651651
...
652652

selectolax/lexbor.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ cdef class LexborHTMLParser:
397397

398398
Returns
399399
-------
400-
text : str
400+
text : str | None
401401
"""
402402
return self.root.inner_html
403403

selectolax/lexbor/node.pxi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ cdef class LexborNode:
903903

904904
Returns
905905
-------
906-
text : str
906+
text : str | None
907907
"""
908908

909909
cdef lexbor_str_t *lxb_str
@@ -914,7 +914,8 @@ cdef class LexborNode:
914914
if status == 0 and lxb_str.data:
915915
html = lxb_str.data.decode(_ENCODING).replace('<-undef>', '')
916916
lexbor_str_destroy(lxb_str, self.node.owner_document.text, True)
917-
return html
917+
return html
918+
return None
918919

919920
@inner_html.setter
920921
def inner_html(self, str html):
@@ -925,7 +926,7 @@ cdef class LexborNode:
925926
926927
Parameters
927928
----------
928-
html : str
929+
html : str | None
929930
930931
"""
931932
cdef bytes bytes_val

0 commit comments

Comments
 (0)