You are here

private function HtmlAssetInliner::compress in TMGMT Translator Smartling 8

Same name and namespace in other branches
  1. 8.4 src/Context/HtmlAssetInliner.php \Drupal\tmgmt_smartling\Context\HtmlAssetInliner::compress()
  2. 8.2 src/Context/HtmlAssetInliner.php \Drupal\tmgmt_smartling\Context\HtmlAssetInliner::compress()
  3. 8.3 src/Context/HtmlAssetInliner.php \Drupal\tmgmt_smartling\Context\HtmlAssetInliner::compress()

Compresses generated page by removing extra whitespace

1 call to HtmlAssetInliner::compress()
HtmlAssetInliner::getCompletePage in src/Context/HtmlAssetInliner.php
Gets complete page data and returns generated string

File

src/Context/HtmlAssetInliner.php, line 279

Class

HtmlAssetInliner

Namespace

Drupal\tmgmt_smartling\Context

Code

private function compress($string) {

  # remove whitespace
  return str_replace(array(
    "\r\n",
    "\r",
    "\n",
    "\t",
    '  ',
    '    ',
    '    ',
  ), ' ', $string);
}