Methods |
public static convert(string $html, $options = []) : string Tries to convert the given HTML into a plain text format - best suited for e-mail display, etc.
|
public static defaultOptions() : array
|
public static fixNewlines(string $text) : string Unify newlines; in particular, \r\n becomes \n, and then \r becomes \n. This means that all newlines (Unix, Windows, Mac) all become \ns.
|
public static isOfficeDocument(string $html) : bool Can we guess that this HTML is generated by Microsoft Office? |
public static isWhitespace(string $text) : bool |
public static nbspCodes() : array
|
public static processWhitespaceNewlines(string $text) : string Remove leading or trailing spaces and excess empty lines from provided multiline text
|
public static zwnjCodes() : array
|
Methods |
private static getDocument(string $html, array $options) : DOMDocument Parse HTML into a DOMDocument
|
private static iterateOverNode(DOMNode $node, ?string $prevName, bool $in_pre, bool $is_office_document, array $options) : string
|
private static nextChildName(?DOMNode $node) : ?string |
private static renderText(string $text) : string Replace any special characters with simple text versions, to prevent output issues:
This is to match our goal of rendering documents as they would be rendered by a browser. |
Methods |
public static convert(string $html, $options = []) : string Tries to convert the given HTML into a plain text format - best suited for e-mail display, etc.
|
public static defaultOptions() : array
|
public static fixNewlines(string $text) : string Unify newlines; in particular, \r\n becomes \n, and then \r becomes \n. This means that all newlines (Unix, Windows, Mac) all become \ns.
|
private static getDocument(string $html, array $options) : DOMDocument Parse HTML into a DOMDocument
|
public static isOfficeDocument(string $html) : bool Can we guess that this HTML is generated by Microsoft Office? |
public static isWhitespace(string $text) : bool |
private static iterateOverNode(DOMNode $node, ?string $prevName, bool $in_pre, bool $is_office_document, array $options) : string
|
public static nbspCodes() : array
|
private static nextChildName(?DOMNode $node) : ?string |
public static processWhitespaceNewlines(string $text) : string Remove leading or trailing spaces and excess empty lines from provided multiline text
|
private static renderText(string $text) : string Replace any special characters with simple text versions, to prevent output issues:
This is to match our goal of rendering documents as they would be rendered by a browser. |
public static zwnjCodes() : array
|