You are here

protected function MinifyHTMLExit::minifyhtmlRemoveHtmlComment in Minify Source HTML 8

Helper function to remove HTML comments.

Comments containing IE conditionals will be ignored.

Parameters

array $matches: Matches from initial preg_replace().

Return value

string String with removed HTML comments.

File

src/EventSubscriber/MinifyHTMLExit.php, line 322

Class

MinifyHTMLExit
Minifies the HTML of the response.

Namespace

Drupal\minifyhtml\EventSubscriber

Code

protected function minifyhtmlRemoveHtmlComment(array $matches) {
  return 0 === strpos($matches[1], '[') || FALSE !== strpos($matches[1], '<![') ? $matches[0] : '';
}