1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
include "../utils.pxi"
def create_tag(tag: str):
"""
Given an HTML tag name, e.g. `"div"`, create a single empty node for that tag,
e.g. `"<div></div>"`.
"""
return do_create_tag(tag, HTMLParser)
def parse_fragment(html: str):
"""
Given HTML, parse it into a list of Nodes, such that the nodes
correspond to the given HTML.
For contrast, HTMLParser adds `<html>`, `<head>`, and `<body>` tags
if they are missing. This function does not add these tags.
"""
return do_parse_fragment(html, HTMLParser)
|