Utils Html

inyoka.utils.html

This module implements various HTML utility functions.

copyright:
  1. 2007-2026 by the Inyoka Team, see AUTHORS for more details.

license:

BSD, see LICENSE for more details.

class inyoka.utils.html.AddParagraphs(*, convert_charrefs=True)

Adds <p> to HTML, when a top-level text has no parent element.

data = ''
handle_data(data)
handle_endtag(tag)
handle_starttag(tag, attrs)
inside_tag = False
level = 0
inyoka.utils.html.build_html_tag(tag, class_=None, classes=None, **attrs)

Build an HTML opening tag.

inyoka.utils.html.cleanup_html(html, nh3_cleaner: Cleaner) str