Options
All
  • Public
  • Public/Protected
  • All
Menu

Tries parsing an XHTML string as a modern XHTML5 string, also removes XML styling properties and XSLT references

If document is not valid XML, it tries parsing it as HTML5

Hierarchy

  • XhtmlParser

Implements

Index

Constructors

constructor

  • new XhtmlParser(xhtmlString: string, path: string, forceHtml: boolean): XhtmlParser
  • Creates a new instance and parses the given XHTML or HTML string.

    Parameters

    • xhtmlString: string

      The XHTML or HTML string to parse.

    • path: string

      The path to the file (used for error reporting).

    • forceHtml: boolean

      Parse the string as a HTML document. Don't try to parse the string as XHTML.

    Returns XhtmlParser

Methods

getDocument

  • getDocument(): HTMLDocument
  • Get the parsed document if it was parsed successfully.

    Returns HTMLDocument

getParserError

  • getParserError(): HTMLDocument

getXmlHeader

  • getXmlHeader(): string

isHtmlDocument

  • isHtmlDocument(): boolean

isXhtmlDocument

  • isXhtmlDocument(): boolean

Generated using TypeDoc