fix(ratex): prevent crash with empty ratex
This commit is contained in:
parent
3a07d78da3
commit
0c2cd61aa1
|
|
@ -255,13 +255,13 @@ fun ChatMarkdown(
|
||||||
|
|
||||||
GFMElementTypes.INLINE_MATH -> {
|
GFMElementTypes.INLINE_MATH -> {
|
||||||
val latex = child.getTextInNode(content).toString().removeSurrounding("$")
|
val latex = child.getTextInNode(content).toString().removeSurrounding("$")
|
||||||
appendInlineContent("math:i:$latex", latex)
|
if (latex.isNotEmpty()) appendInlineContent("math:i:$latex", latex)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
GFMElementTypes.BLOCK_MATH -> {
|
GFMElementTypes.BLOCK_MATH -> {
|
||||||
val latex = child.getTextInNode(content).toString().removeSurrounding("$$").trim()
|
val latex = child.getTextInNode(content).toString().removeSurrounding("$$").trim()
|
||||||
appendInlineContent("math:b:$latex", latex)
|
if (latex.isNotEmpty()) appendInlineContent("math:b:$latex", latex)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue