File tree Expand file tree Collapse file tree
richtext-commonmark/src/commonMain/kotlin/com/halilibo/richtext/markdown Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ import androidx.compose.runtime.CompositionLocalProvider
55import androidx.compose.runtime.compositionLocalOf
66import androidx.compose.runtime.remember
77import androidx.compose.runtime.rememberUpdatedState
8+ import androidx.compose.ui.Modifier
89import androidx.compose.ui.platform.LocalUriHandler
10+ import androidx.compose.ui.semantics.heading
11+ import androidx.compose.ui.semantics.semantics
912import com.halilibo.richtext.markdown.node.AstBlockQuote
1013import com.halilibo.richtext.markdown.node.AstBulletList
1114import com.halilibo.richtext.markdown.node.AstDocument
@@ -133,7 +136,7 @@ internal fun RichTextScope.RecursiveRenderMarkdownAst(astNode: AstNode?) {
133136 }
134137 is AstHeading -> {
135138 Heading (level = astNodeType.level) {
136- MarkdownRichText (astNode)
139+ MarkdownRichText (astNode, Modifier .semantics { heading() } )
137140 }
138141 }
139142 is AstIndentedCodeBlock -> {
Original file line number Diff line number Diff line change @@ -56,14 +56,14 @@ import com.halilibo.richtext.ui.string.withFormat
5656 * @param astNode Root node to accept as Text Content container.
5757 */
5858@Composable
59- internal fun RichTextScope.MarkdownRichText (astNode : AstNode ) {
59+ internal fun RichTextScope.MarkdownRichText (astNode : AstNode , modifier : Modifier = Modifier ) {
6060 val onLinkClicked = LocalOnLinkClicked .current
6161 // Assume that only RichText nodes reside below this level.
6262 val richText = remember(astNode, onLinkClicked) {
6363 computeRichTextString(astNode, onLinkClicked)
6464 }
6565
66- Text (text = richText)
66+ Text (text = richText, modifier = modifier )
6767}
6868
6969private fun computeRichTextString (
You can’t perform that action at this time.
0 commit comments