Skip to content

Commit 3ee1b53

Browse files
committed
Do not remove text alignment attribute if the span handles alignment by itself
1 parent a5b2a07 commit 3ee1b53

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/AztecParser.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,9 @@ class AztecParser(val plugins: List<IAztecPlugin> = ArrayList()) {
371371
private fun withinNestable(out: StringBuilder, text: Spanned, start: Int, end: Int,
372372
nestable: IAztecParagraphStyle, parents: ArrayList<IAztecNestable>?, nestingLevel: Int) {
373373

374-
CssStyleFormatter.removeStyleAttribute(nestable.attributes, CssStyleFormatter.CSS_TEXT_ALIGN_ATTRIBUTE)
375374
if (nestable.shouldParseAlignmentToHtml()) {
375+
CssStyleFormatter.removeStyleAttribute(nestable.attributes, CssStyleFormatter.CSS_TEXT_ALIGN_ATTRIBUTE)
376+
376377
nestable.align?.let {
377378
val direction = TextDirectionHeuristicsCompat.FIRSTSTRONG_LTR
378379
val isRtl = direction.isRtl(text, start, end - start)

0 commit comments

Comments
 (0)