Skip to content

Commit 772a691

Browse files
committed
Fix typo for tag names. Clarify available tag names.
1 parent 1f9b78d commit 772a691

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- Improve unicode handling for malformed text. Resolves #138.
1515
- Fix segfaults when doing double `.decompose`. Resolves #179.
1616
- Fix sefgaults when doing double `.unwrap`. Resolves #169.
17+
- Fix typo for tag names. Clarify available tag names.
1718

1819
## Version 0.3.34
1920

selectolax/lexbor.pyi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,12 @@ class LexborNode:
267267
def tag(self) -> str | None:
268268
"""Return the name of the current tag (e.g. div, p, img).
269269
270+
For for non-tag nodes, returns the following names:
271+
272+
* `-text` - text node
273+
* `-document` - document node
274+
* `-comment` - comment node
275+
270276
Returns
271277
-------
272278
text : str

selectolax/lexbor/node.pxi

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import logging
66
logger = logging.getLogger("selectolax")
77

88
_TAG_TO_NAME = {
9-
0x0005: "- doctype",
9+
0x0005: "-doctype",
1010
0x0002: "-text",
1111
0x0004: "-comment",
1212
}
@@ -261,6 +261,14 @@ cdef class LexborNode:
261261
def tag(self):
262262
"""Return the name of the current tag (e.g. div, p, img).
263263
264+
For for non-tag nodes, returns the following names:
265+
266+
* `-text` - text node
267+
* `-document` - document node
268+
* `-comment` - comment node
269+
270+
This
271+
264272
Returns
265273
-------
266274
text : str

0 commit comments

Comments
 (0)