Skip to content

Commit aea1b7d

Browse files
committed
Add editor to horizontal rule span parameters
1 parent 71c83fd commit aea1b7d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ class LineBlockFormatter(editor: AztecText) : AztecFormatter(editor) {
127127
val span = AztecHorizontalRuleSpan(
128128
editor.context,
129129
ContextCompat.getDrawable(editor.context, R.drawable.img_hr),
130-
nestingLevel
130+
nestingLevel,
131+
editor
131132
)
132133

133134
val builder = SpannableStringBuilder(Constants.MAGIC_STRING)

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ package org.wordpress.aztec.spans
33
import android.content.Context
44
import android.graphics.drawable.Drawable
55
import org.wordpress.aztec.AztecAttributes
6+
import org.wordpress.aztec.AztecText
67

78
class AztecHorizontalRuleSpan(context: Context, drawable: Drawable, override var nestingLevel: Int,
8-
override var attributes: AztecAttributes = AztecAttributes()) :
9+
editor: AztecText? = null, override var attributes: AztecAttributes = AztecAttributes()) :
910
AztecDynamicImageSpan(context, drawable), AztecFullWidthImageSpan, AztecSpan {
1011

12+
init {
13+
textView = editor
14+
}
15+
1116
override val TAG: String = "hr"
12-
}
17+
}

0 commit comments

Comments
 (0)