CommentParser
in package
Table of Contents
Methods
- removeCommentsFromStyleBlocks() : string
- Remove HTML and CSS comments from style blocks.
- removeHtmlComments() : string
- Remove mPDF-specific and general HTML comments from content.
Methods
removeCommentsFromStyleBlocks()
Remove HTML and CSS comments from style blocks.
public
removeCommentsFromStyleBlocks(string $html) : string
Removes both HTML comments () and CSS comments from
<style> tag contents while preserving the structure.Parameters
- $html : string
-
HTML content with style tags
Return values
string —HTML with cleaned style blocks
removeHtmlComments()
Remove mPDF-specific and general HTML comments from content.
public
removeHtmlComments(string $html) : string
Removes markers and all HTML comments.
Parameters
- $html : string
-
HTML content to clean
Return values
string —HTML with comments removed