.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2020 by Total Control Software License: wxWindows License .. include:: headings.inc .. _wx.html.HtmlTagHandler: ========================================================================================================================================== |phoenix_title| **wx.html.HtmlTagHandler** ========================================================================================================================================== .. seealso:: :ref:`Tag Handlers `, :ref:`wx.html.HtmlTag` .. todo:: describe me | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class HtmlTagHandler:
| |sub_classes| Known Subclasses ============================== :ref:`wx.html.HtmlWinTagHandler` | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.html.HtmlTagHandler.__init__` Constructor. :meth:`~wx.html.HtmlTagHandler.GetParser` Returns the parser associated with this tag handler. :meth:`~wx.html.HtmlTagHandler.GetSupportedTags` Returns list of supported tags. :meth:`~wx.html.HtmlTagHandler.HandleTag` This is the core method of each handler. :meth:`~wx.html.HtmlTagHandler.ParseInner` This method calls parser's :meth:`wx.html.HtmlParser.DoParsing` method for the string between this tag and the paired ending tag :meth:`~wx.html.HtmlTagHandler.ParseInnerSource` Parses given source as if it was tag's inner code (see `HtmlParser.GetInnerSource).` :meth:`~wx.html.HtmlTagHandler.SetParser` Assigns `parser` to this handler. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~wx.html.HtmlTagHandler.Parser` See :meth:`~wx.html.HtmlTagHandler.GetParser` and :meth:`~wx.html.HtmlTagHandler.SetParser` :attr:`~wx.html.HtmlTagHandler.SupportedTags` See :meth:`~wx.html.HtmlTagHandler.GetSupportedTags` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: wx.html.HtmlTagHandler(Object) **Possible constructors**:: HtmlTagHandler() .. method:: __init__(self) Constructor. .. method:: GetParser(self) Returns the parser associated with this tag handler. :rtype: :ref:`wx.html.HtmlParser` .. versionadded:: 2.9.5 .. method:: GetSupportedTags(self) Returns list of supported tags. The list is in uppercase and tags are delimited by ','. Example: ``"I,B,FONT,P"`` :rtype: `string` .. method:: HandleTag(self, tag) This is the core method of each handler. It is called each time one of supported tags is detected. `tag` contains all necessary info (see :ref:`wx.html.HtmlTag` for details). Example: :: def HandleTag(self, tag): # change state of parser (e.g. set bold face) self.ParseInner(tag) # ... # restore original state of parser You shouldn't call :meth:`ParseInner` if the tag is not paired with an ending one. :param `tag`: :type `tag`: wx.html.HtmlTag :rtype: `bool` :returns: ``True`` if :meth:`ParseInner` was called, ``False`` otherwise. .. method:: ParseInner(self, tag) This method calls parser's :meth:`wx.html.HtmlParser.DoParsing` method for the string between this tag and the paired ending tag: .. code-block:: html Hello, world! In this example, a call to :meth:`ParseInner` (with `tag` pointing to A tag) will parse 'Hello, world!'. :param `tag`: :type `tag`: wx.html.HtmlTag .. method:: ParseInnerSource(self, source) Parses given source as if it was tag's inner code (see `HtmlParser.GetInnerSource).` Unlike :meth:`ParseInner` , this method lets you specify the source code to parse. This is useful when you need to modify the inner text before parsing. :param `source`: :type `source`: string .. method:: SetParser(self, parser) Assigns `parser` to this handler. Each **instance** of handler is guaranteed to be called only from the one parser. :param `parser`: :type `parser`: wx.html.HtmlParser .. attribute:: Parser See :meth:`~wx.html.HtmlTagHandler.GetParser` and :meth:`~wx.html.HtmlTagHandler.SetParser` .. attribute:: SupportedTags See :meth:`~wx.html.HtmlTagHandler.GetSupportedTags`