mikepenz / multiplatform-markdown-renderer

Markdown renderer for Kotlin Multiplatform Projects (Android, iOS, Desktop), using Compose.
https://mikepenz.github.io/multiplatform-markdown-renderer/
Apache License 2.0
429 stars 27 forks source link

Custom link handler #182

Closed chokokatana closed 4 months ago

chokokatana commented 4 months ago

About this issue

I don't see any mechanism through which I can handle link clicking by myself, links open by default in an external browser but I'd like to handle them myself.

Details

Checklist

FAQ file doesn't exist any more.

mikepenz commented 4 months ago

Good day.

The library uses the LocalUriHandler.current to open the URL. This defaults to open in a browser on android: https://github.com/mikepenz/multiplatform-markdown-renderer/blob/6f04f9745009f47d0fca27c4952123f07bfe9f55/multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/compose/elements/MarkdownText.kt#L98

You can provide your own handler via the CompositionLocal

chokokatana commented 4 months ago

Oof, that's so hidden.