File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
shared/src/commonMain/kotlin/dev/dimension/flare/ui/model/mapper Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -764,7 +764,9 @@ private fun moe.tlaster.mfm.parser.tree.Node.toHtml(accountKey: MicroBlogKey): E
764764 Element (" a" ).apply {
765765// attributes["href"] = url
766766 attributes().put(" href" , url)
767- appendChild(TextNode (content))
767+ content.forEach {
768+ appendChild(it.toHtml(accountKey))
769+ }
768770 }
769771 }
770772
@@ -801,7 +803,12 @@ private fun moe.tlaster.mfm.parser.tree.Node.toHtml(accountKey: MicroBlogKey): E
801803
802804 is moe.tlaster.mfm.parser.tree.TextNode -> {
803805 Element (" span" ).apply {
804- appendChild(TextNode (content))
806+ content.split(" \n " ).forEachIndexed { index, line ->
807+ if (index != 0 ) {
808+ appendChild(Element (" br" ))
809+ }
810+ appendChild(TextNode (line))
811+ }
805812 }
806813 }
807814
You can’t perform that action at this time.
0 commit comments