The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



ConvertHTMLBodyToText


Unit: SDL_htmlsupport
Class: none
Declaration: function ConvertHTMLBodyToText (InString: string; ListIndicator: char): string;

The function ConvertHTMLBodyToText converts the HTML code contained in the body of an HTML file to plain text. The parameter Instring holds the HTML file as a string. The parameter ListIndicator specifies the character which is used as a replacement for the <li> tag. Set ListIndicator to #0 in order to suppress the replacement. The conversion performs the following changes:
  • The tags <p>, <br>, </ul> and <tr> tags are replaced by carriage return/line feed (CRLF) characters,
  • the <li> is replaced by CRLF if the ListIndicator is #0, or by CRLF+ListIndicator+' ' if it is not #0;
  • all other tags are removed


Last Update: 2016-Jun-26