diff --git a/changelog.d/5679.bugfix b/changelog.d/5679.bugfix new file mode 100644 index 0000000000..0394bc3e5d --- /dev/null +++ b/changelog.d/5679.bugfix @@ -0,0 +1 @@ +Fix italic text is truncated when bubble mode and markdown is enabled diff --git a/vector/src/main/java/im/vector/app/features/html/EventHtmlRenderer.kt b/vector/src/main/java/im/vector/app/features/html/EventHtmlRenderer.kt index 9a2bdc791e..21fcbffb03 100644 --- a/vector/src/main/java/im/vector/app/features/html/EventHtmlRenderer.kt +++ b/vector/src/main/java/im/vector/app/features/html/EventHtmlRenderer.kt @@ -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(""".*?""")) { 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.