MarkdownText: fix marker characters hidden even if they are not part of a markup

This commit is contained in:
MM20 2023-06-12 16:40:05 +02:00
parent 068967e6b4
commit 1e1831b537
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389
2 changed files with 10 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package de.mm20.launcher2.ui.component.markdown
import android.util.Log
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
@ -283,4 +284,11 @@ fun CheckboxNode(node: ASTNode, text: String, onTextChange: (String) -> Unit = {
.padding(top = 4.dp, bottom = 4.dp, end = 8.dp)
.requiredSize(18.dp)
)
}
private fun ASTNode.print(indent: Int = 0) {
Log.d("MM20", "${" ".repeat(indent)}${this.type}")
for (child in this.children) {
child.print(indent + 2)
}
}

View File

@ -130,7 +130,8 @@ fun AnnotatedString.Builder.applyStyles(
node.type != MarkdownTokenTypes.TEXT &&
node.type != MarkdownTokenTypes.WHITE_SPACE &&
node.type != MarkdownTokenTypes.CODE_FENCE_CONTENT &&
node.type != MarkdownTokenTypes.CODE_LINE
node.type != MarkdownTokenTypes.CODE_LINE &&
node.parent?.type != MarkdownElementTypes.PARAGRAPH
) {
addStyle(
delimiterStyle,