mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-25 23:39:00 +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
|
// It needs to be in this specific format: https://noties.io/Markwon/docs/v4/ext-latex
|
||||||
builder
|
builder
|
||||||
.usePlugin(object : AbstractMarkwonPlugin() {
|
.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 {
|
override fun processMarkdown(markdown: String): String {
|
||||||
return markdown
|
return markdown
|
||||||
.replace(Regex("""<span\s+data-mx-maths="([^"]*)">.*?</span>""")) { matchResult ->
|
.replace(Regex("""<span\s+data-mx-maths="([^"]*)">.*?</span>""")) { matchResult ->
|
||||||
|
@ -133,6 +127,12 @@ class EventHtmlRenderer @Inject constructor(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.usePlugin(object : AbstractMarkwonPlugin() {
|
.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) {
|
override fun configureParser(builder: Parser.Builder) {
|
||||||
/* Configuring the Markwon block formatting processor.
|
/* Configuring the Markwon block formatting processor.
|
||||||
* Default settings are all Markdown blocks. Turn those off.
|
* Default settings are all Markdown blocks. Turn those off.
|
||||||
|
|
Loading…
Add table
Reference in a new issue