Skip to content

Commit 1f51c88

Browse files
committed
added attributes handling for ruler tag <hr>
1 parent d082e80 commit 1f51c88

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ class AztecTagHandler(val context: Context, val plugins: List<IAztecPlugin> = Ar
116116
LINE -> {
117117
if (opening) {
118118
// Add an extra newline above the line to prevent weird typing on the line above
119-
start(output, AztecHorizontalRuleSpan(context, ContextCompat.getDrawable(context, R.drawable.img_hr), nestingLevel))
119+
start(output, AztecHorizontalRuleSpan(context, ContextCompat.getDrawable(context, R.drawable.img_hr),
120+
nestingLevel, AztecAttributes(attributes)))
120121
output.append(Constants.MAGIC_CHAR)
121122
} else {
122123
end(output, AztecHorizontalRuleSpan::class.java)

aztec/src/main/kotlin/org/wordpress/aztec/formatting/LineBlockFormatter.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ class LineBlockFormatter(editor: AztecText) : AztecFormatter(editor) {
106106
editor.context,
107107
ContextCompat.getDrawable(editor.context, R.drawable.img_hr),
108108
nestingLevel,
109+
AztecAttributes(),
109110
editor
110111
)
111112

aztec/src/main/kotlin/org/wordpress/aztec/spans/AztecHorizontalRuleSpan.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import org.wordpress.aztec.AztecAttributes
66
import org.wordpress.aztec.AztecText
77

88
class AztecHorizontalRuleSpan(context: Context, drawable: Drawable, override var nestingLevel: Int,
9-
editor: AztecText? = null, override var attributes: AztecAttributes = AztecAttributes()) :
9+
override var attributes: AztecAttributes = AztecAttributes(), editor: AztecText? = null) :
1010
AztecDynamicImageSpan(context, drawable), IAztecFullWidthImageSpan, IAztecSpan {
1111
init {
1212
textView = editor

0 commit comments

Comments
 (0)