Skip to content

Commit 8b79fc5

Browse files
committed
DIV, FIGURE, FIGCAPTION, SECTION are block level elements
1 parent 555df8b commit 8b79fc5

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import org.wordpress.aztec.spans.AztecQuoteSpan
4141
import org.wordpress.aztec.spans.AztecStrikethroughSpan
4242
import org.wordpress.aztec.spans.AztecUnorderedListSpan
4343
import org.wordpress.aztec.spans.AztecVideoSpan
44+
import org.wordpress.aztec.spans.HiddenHtmlBlock
4445
import org.wordpress.aztec.spans.HiddenHtmlSpan
4546
import org.wordpress.aztec.spans.IAztecAttributedSpan
4647
import org.wordpress.aztec.spans.IAztecNestable
@@ -75,10 +76,14 @@ class AztecTagHandler(val context: Context, val plugins: List<IAztecPlugin> = Ar
7576
handleElement(output, opening, AztecStrikethroughSpan(tag, AztecAttributes(attributes)))
7677
return true
7778
}
78-
DIV, SPAN, FIGURE, FIGCAPTION, SECTION -> {
79+
SPAN -> {
7980
handleElement(output, opening, HiddenHtmlSpan(tag, AztecAttributes(attributes), nestingLevel))
8081
return true
8182
}
83+
DIV, FIGURE, FIGCAPTION, SECTION -> {
84+
handleElement(output, opening, HiddenHtmlBlock(tag, AztecAttributes(attributes), nestingLevel))
85+
return true
86+
}
8287
LIST_UL -> {
8388
handleElement(output, opening, AztecUnorderedListSpan(nestingLevel, AztecAttributes(attributes)))
8489
return true
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.wordpress.aztec.spans
2+
3+
import android.text.Layout
4+
import org.wordpress.aztec.AztecAttributes
5+
6+
class HiddenHtmlBlock(tag: String, override var attributes: AztecAttributes = AztecAttributes(),
7+
override var nestingLevel: Int) : IAztecBlockSpan {
8+
override var endBeforeBleed: Int = -1
9+
override var startBeforeCollapse: Int = -1
10+
11+
override var align: Layout.Alignment? = null
12+
13+
override val TAG: String = tag
14+
}

0 commit comments

Comments
 (0)