A simple document for testing
This note is for testing functions related to the note Parsing HTML files with lxml.
Internal (broken) anchor link test A third level heading.
Anchor link on another page: notes / Polynomial function.
A second level heading
A paragraph that falls beneath the second level heading.
A third level heading
Some third level text.With a br tag prior to this sentence.
Another third level heading with a code block
Text for the “Another third level heading” heading.
A paragraph preceding a code block:
def serialize(fragment: HtmlElement, pretty_print: bool = False):
return html.tostring(
fragment,
pretty_print=pretty_print,
method="html",
encoding="unicode",
)
def get_heading_level(tag: str) -> int:
heading_levels = {"h1": 0, "h2": 1, "h3": 2, "h4": 3, "h5": 4, "h6": 5}
return heading_levels[tag]
A paragraph following a code block.
The second second level heading
Second second level heading first paragraph.
Second second level heading second paragraph, with some bold text.
Tags: