THTML2TextRenderer class
Implements an HTML-to-Text renderer.
Declaration
THTML2TextRenderer = classDescription
THTML2TextRenderer is an HTML-to-Text renderer. It converts HTML
into plain text by stripping tags and their attributes. Converted text
includes configurable indentation for HTML tags that affect the indentation
level. The following HTML tags include special processing in the renderer:
- HTML
- BODY
- P
- BR
- HR
- OL
- UL
- LI
- DIV CLASS="TITLE" (forces title mark output)
The following Named character entities are converted to their plain text equivalent:
-
- ' '
- <
- '<'
- >
- '>;'
- &
- '&'
Other named character entities or numeric character entities are included verbatim in the plain text output.
A UTF-8 Byte Order Mark in the HTML is ignored.
Set property values in the class instance to customize the content and formatting produced in the output. Use the Render method to parse and process the HTML content passed to the constructor, and generate the output for the class instance.
See also
Properties
LineEndMark | public | Defines the end-of-line character sequence. |
TitleMark | public | Defines the character used to delimit a title or header. |
HorzLineMark | public | Represents a HR tag in the plaint text output. |
LinkBeginMark | public | Represents an A start tag in the plain text output. |
LinkEndMark | public | Represents an A end tag in the plain text output. |
ListItemMark | public | Represents a list item in the plain text output. |
MoreMark | public | Indicates that the plain text output is truncated due to a line limit restriction. |
MaxLineLen | public | Maximum number of characters allowed in a line output by the renderer. |
IndentStep | public | Increment (in spaces) for each nested HTML level. |
Methods
Create | public | Constructor for the class instance. |
Destroy | public | Frees the class instance. |
Render | public | Parses the HTML and renders the plain text output. |
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
