Module Expr Str Import alias Import alias ImportFrom alias ImportFrom alias alias If NameLoad body ImportFrom alias identifier alias ImportFrom alias orelse ImportFrom alias identifier alias ImportFrom alias FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr BinOpMod Str Call AttributeLoad Str attr NameLoad Lambda arguments args NameParam defaults Call NameLoad SubscriptLoad NameLoad Index Call AttributeLoad NameLoad attr Num NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad For TupleStore NameStore NameStore NameLoad body If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad Call NameLoad NameLoad keyword NameLoad Return Call AttributeLoad Str attr NameLoad decorator_list If CompareLt AttributeLoad NameLoad attr TupleLoad Num Num body ClassDef bases NameLoad NameLoad body Pass decorator_list orelse ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr IfExp NameLoad BinOpMod Str TupleLoad NameLoad Call NameLoad NameLoad BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type NameLoad body Pass Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str TupleLoad NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd BinOpAdd Str NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd BinOpAdd Str NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd BinOpAdd Str NameLoad Str decorator_list decorator_list Assign NameStore ListLoad Str Str Str
N/A N/A 
Generic HTML tools
~~~~~~~~~~~~~~~~~~

A collection of tools that ease reading and writing HTML. Currently,
there's only a improved version of python's :class:`HTMLParser.HTMLParser`,
that returns the HTML untouched, so you can override specific calls to
add custom behavior.

This implementation is used :mod:`acrylamid.filters.acronyms`,
:mod:`acrylamid.filters.hyphenation` and more advanced in
:mod:`acrylamid.filters.summarize`. It is quite fast, but remains
an unintuitive way of working with HTML. N/A sys N/A re cgi escape acrylamid.compat PY2K unichr N/A PY2K N/A HTMLParser HTMLParser DefaultParser HTMLParseError htmlentitydefs name2codepoint N/A html.parser HTMLParser DefaultParser HTMLParseError html.entities name2codepoint unescape N/A N/A s N/A N/A N/A &amp; -> & conversion N/A N/A N/A re sub N/A &(%s); N/A N/A | join name2codepoint N/A N/A N/A m N/A N/A unichr N/A name2codepoint N/A N/A N/A m group 1 s N/A format N/A N/A attrs N/A N/A N/A res N/A N/A N/A key value attrs N/A N/A N/A value None N/A N/A N/A N/A res append key N/A N/A N/A N/A res append N/A %s="%s" N/A key N/A escape value quote True N/A N/A N/A join res N/A N/A N/A N/A sys version_info N/A 3 0 N/A WTFMixin N/A object DefaultParser N/A N/A N/A N/A WTFMixin N/A DefaultParser N/A N/A N/A HTMLParser N/A WTFMixin N/A N/A A more useful base HTMLParser that returns the actual HTML by
    default::

    >>> "<b>Foo</b>" == HTMLParser("<b>Foo</b>").result

    It is intended to use this class as base so you don't make
    the same mistakes I did before.

    .. attribute:: result

        This is the processed HTML. __init__ N/A N/A self html N/A N/A N/A N/A N/A DefaultParser __init__ self N/A N/A self result N/A N/A N/A self stack N/A N/A N/A N/A self feed html N/A handle_starttag N/A N/A self tag attrs N/A N/A N/A Append tag to stack and write it to result. N/A N/A N/A N/A self stack append tag N/A N/A N/A N/A self result append N/A attrs N/A <%s %s> N/A tag N/A format attrs N/A <%s> tag N/A handle_data N/A N/A self data N/A N/A N/A Everything that is *not* a tag shows up as data, but you can't expect
       that it is always a continous sentence or word. N/A N/A N/A N/A self result append data N/A handle_endtag N/A N/A self tag N/A N/A N/A Append ending tag to result and pop it from the stack too. N/A N/A N/A N/A N/A N/A self stack pop N/A N/A N/A IndexError N/A N/A N/A N/A N/A N/A self result append N/A </%s> tag N/A handle_startendtag N/A N/A self tag attrs N/A N/A N/A Something like ``"<br />"`` N/A N/A N/A N/A self result append N/A <%s %s/> N/A tag N/A format attrs N/A handle_entityref N/A N/A self name N/A N/A N/A An escaped ampersand like ``"&#38;"``. N/A N/A N/A N/A self result append N/A N/A & name ; N/A handle_charref N/A N/A self char N/A N/A N/A An escaped umlaut like ``"&auml;"`` N/A N/A N/A N/A self result append N/A N/A &# char ; N/A handle_comment N/A N/A self comment N/A N/A N/A Preserve HTML comments. N/A N/A N/A N/A self result append N/A N/A <!-- comment --> N/A N/A N/A __all__ N/A HTMLParser HTMLParseError unescape