AbstractHtmlProcessor
Base class for HTML processor that e.g., can remove, add or modify nodes or attributes.
Description Description
The "vanilla" subclass is the HtmlNormalizer.
Source Source
File: vendor/pelago/emogrifier/src/Emogrifier/HtmlProcessor/AbstractHtmlProcessor.php
Methods Methods
- __construct — The constructor.
- addContentTypeMetaTag — Adds a Content-Type meta tag for the charset.
- createRawDomDocument — Creates a DOMDocument instance from the given HTML and stores it in $this->domDocument.
- createUnifiedDomDocument — Creates a DOM document from the given HTML and stores it in $this->domDocument.
- ensureDocumentType — Makes sure that the passed HTML has a document type.
- ensureExistenceOfBodyElement — Checks that $this->domDocument has a BODY element and adds it if it is missing.
- ensurePhpUnrecognizedSelfClosingTagsAreXml — Makes sure that any self-closing tags not recognized as such by PHP's DOMDocument implementation have a self-closing slash.
- fromDomDocument — Builds a new instance from the given DOM document.
- fromHtml — Builds a new instance from the given HTML.
- getBodyElement — Returns the BODY element.
- getDomDocument — Provides access to the internal DOMDocument representation of the HTML in its current state.
- prepareHtmlForDomConversion — Returns the HTML with added document type, Content-Type meta tag, and self-closing slashes, if needed, ensuring that the HTML will be good for creating a DOM document from it.
- removeSelfClosingTagsClosingTags — Eliminates any invalid closing tags for void elements from the given HTML.
- render — Renders the normalized and processed HTML.
- renderBodyContent — Renders the content of the BODY element of the normalized and processed HTML.
- setDomDocument
- setHtml — Sets the HTML to process.