- Set left text alignment on all elements when alignment is otherwise

absent
This commit is contained in:
Vlad
2016-04-05 09:52:22 -04:00
parent 7e5e8a4282
commit 8a664aa7f1
2 changed files with 5 additions and 2 deletions

View File

@@ -72,6 +72,9 @@ class Text {
continue;
}
$style = $paragraph->style;
if (!preg_match('/text-align/i', $style)) {
$style = 'text-align: left;' . $style;
}
$contents = $paragraph->html();
$paragraph->setTag('table');
$paragraph->style = 'border-spacing:0;mso-table-lspace:0;mso-table-rspace:0;';
@@ -81,7 +84,7 @@ class Text {
<tr>
<td class="mailpoet_paragraph" style="line-height:' . StylesHelper::$line_height . ';word-break:break-word;word-wrap:break-word;' . $style . '">
' . $contents . '
<br />
<br /><br />
</td>
</tr>'
);

View File

@@ -80,7 +80,7 @@ class StylesHelper {
$text_alignment = isset($block['styles']['block']['textAlign']) ?
strtolower($block['styles']['block']['textAlign']) :
false;
if(!$text_alignment || !in_array($text_alignment, $alignments)) {
if(in_array($text_alignment, $alignments)) {
return $block;
}
$block['styles']['block']['textAlign'] = 'left';