Have anyone use <https://github.com/mikepenz/multi...
# compose
f
Have anyone use https://github.com/mikepenz/multiplatform-markdown-renderer In libs.toml file.
Copy code
markdown-material3 = {module = "com.mikepenz:multiplatform-markdown-renderer-m3", version.ref = "textMarkDown"}
markdown = {module = "com.mikepenz:multiplatform-markdown-renderer", version.ref = "textMarkDown"}
Copy code
MarkdownText(
    content = translationText,
    style = lTexts.bodyTinyNormalDevnagri,
)
Getting this excepion.
Copy code
java.lang.IllegalStateException: CompositionLocal ReferenceLinkHandler not present
                                                                                                    	at com.mikepenz.markdown.compose.ComposeLocalKt$LocalReferenceLinkHandler$1.invoke(ComposeLocal.kt:37)
                                                                                                    	at com.mikepenz.markdown.compose.ComposeLocalKt$LocalReferenceLinkHandler$1.invoke(ComposeLocal.kt:36)
👍 1
Can you tell me how to pass this ReferenceLinkHandler Documentations also doesn't refer anything like that.
s
Perhaps it wants you to do a
Copy code
CompositionLocalProvider(ReferenceLinkHandler provides {{Your Impl Here}}) {
  yourAppHere()
}
f
I had already tried that but then it is asking for implementation of MarkMarkdown colors
s
Well, sounds like then you know how to solve the errors as they are coming in. What is the problem then?
f
Thanks. After going through code-references i found that we have to call
MarkDown()
composable which defines all the necessary CompositionLocalProvider variables.
MarkdownText()
composable fn should to be internally call by library because it access data via composition.curent .
👍 1
m
Yes that is correct. the
Markdown()
function is the correct top level one for using the library. Please see the reference in the README: https://github.com/mikepenz/multiplatform-markdown-renderer?tab=readme-ov-file#usage Small note: Be aware of the import. as the material2 or material3 provide different default themes. The internal ones are exposed, as different use-cases might require more fine grained behavior. And various projects have modified behavior, which they required to have access to the base components as well.
f
Hey Mike, In a sentence i have have index of words which i want to underline. I know that Standard mark-down dont support underline. But in my usecase i need to some important words underlined. Can you help me how can using this library? Can markdownAnnotator() help?