- Set left text alignment on all elements when alignment is otherwise
absent
This commit is contained in:
@@ -72,6 +72,9 @@ class Text {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$style = $paragraph->style;
|
$style = $paragraph->style;
|
||||||
|
if (!preg_match('/text-align/i', $style)) {
|
||||||
|
$style = 'text-align: left;' . $style;
|
||||||
|
}
|
||||||
$contents = $paragraph->html();
|
$contents = $paragraph->html();
|
||||||
$paragraph->setTag('table');
|
$paragraph->setTag('table');
|
||||||
$paragraph->style = 'border-spacing:0;mso-table-lspace:0;mso-table-rspace:0;';
|
$paragraph->style = 'border-spacing:0;mso-table-lspace:0;mso-table-rspace:0;';
|
||||||
@@ -81,7 +84,7 @@ class Text {
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="mailpoet_paragraph" style="line-height:' . StylesHelper::$line_height . ';word-break:break-word;word-wrap:break-word;' . $style . '">
|
<td class="mailpoet_paragraph" style="line-height:' . StylesHelper::$line_height . ';word-break:break-word;word-wrap:break-word;' . $style . '">
|
||||||
' . $contents . '
|
' . $contents . '
|
||||||
<br />
|
<br /><br />
|
||||||
</td>
|
</td>
|
||||||
</tr>'
|
</tr>'
|
||||||
);
|
);
|
||||||
|
@@ -80,7 +80,7 @@ class StylesHelper {
|
|||||||
$text_alignment = isset($block['styles']['block']['textAlign']) ?
|
$text_alignment = isset($block['styles']['block']['textAlign']) ?
|
||||||
strtolower($block['styles']['block']['textAlign']) :
|
strtolower($block['styles']['block']['textAlign']) :
|
||||||
false;
|
false;
|
||||||
if(!$text_alignment || !in_array($text_alignment, $alignments)) {
|
if(in_array($text_alignment, $alignments)) {
|
||||||
return $block;
|
return $block;
|
||||||
}
|
}
|
||||||
$block['styles']['block']['textAlign'] = 'left';
|
$block['styles']['block']['textAlign'] = 'left';
|
||||||
|
Reference in New Issue
Block a user