mirror of
https://github.com/element-hq/element-android
synced 2024-11-23 18:05:36 +03:00
Fix the place of the span factory.
This commit is contained in:
parent
a31a9ab521
commit
ab94b21807
2 changed files with 7 additions and 6 deletions
1
changelog.d/5679.bugfix
Normal file
1
changelog.d/5679.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Fix italic text is truncated when bubble mode and markdown is enabled
|
|
@ -98,12 +98,6 @@ class EventHtmlRenderer @Inject constructor(
|
|||
// It needs to be in this specific format: https://noties.io/Markwon/docs/v4/ext-latex
|
||||
builder
|
||||
.usePlugin(object : AbstractMarkwonPlugin() {
|
||||
override fun configureSpansFactory(builder: MarkwonSpansFactory.Builder) {
|
||||
builder.setFactory(
|
||||
Emphasis::class.java
|
||||
) { _, _ -> CustomTypefaceSpan(Typeface.create(Typeface.DEFAULT, Typeface.ITALIC)) }
|
||||
}
|
||||
|
||||
override fun processMarkdown(markdown: String): String {
|
||||
return markdown
|
||||
.replace(Regex("""<span\s+data-mx-maths="([^"]*)">.*?</span>""")) { matchResult ->
|
||||
|
@ -133,6 +127,12 @@ class EventHtmlRenderer @Inject constructor(
|
|||
)
|
||||
)
|
||||
.usePlugin(object : AbstractMarkwonPlugin() {
|
||||
override fun configureSpansFactory(builder: MarkwonSpansFactory.Builder) {
|
||||
builder.setFactory(
|
||||
Emphasis::class.java
|
||||
) { _, _ -> CustomTypefaceSpan(Typeface.create(Typeface.DEFAULT, Typeface.ITALIC)) }
|
||||
}
|
||||
|
||||
override fun configureParser(builder: Parser.Builder) {
|
||||
/* Configuring the Markwon block formatting processor.
|
||||
* Default settings are all Markdown blocks. Turn those off.
|
||||
|
|
Loading…
Reference in a new issue