Skip to content

Commit

Permalink
Edited for weird edge case where there was a tab instead of a space
Browse files Browse the repository at this point in the history
  • Loading branch information
romaincazier committed Jan 13, 2023
1 parent 02ce3bb commit f06f9b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion PageMjmlToHtml.module
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ class PageMjmlToHtml extends WireData implements Module, ConfigurableModule {

$mjml = $parentEvent->return;
if(!$this->disableMinify) {
$mjml = preg_replace("/[\r\t\f\v]+| {2,}/", "", $mjml);
$mjml = preg_replace("/(\w)\t(\w)/", '$1 $2', $mjml);
$mjml = preg_replace("/[\r\t\f\v]+/", "", $mjml);
$mjml = preg_replace("/ {2,}/", " ", $mjml);
$mjml = preg_replace("/\n{2,}/", "\n", $mjml);
}
$mjml = $this->callToApi($mjml);
Expand Down

0 comments on commit f06f9b5

Please sign in to comment.