Skip to content

Commit b6a2097

Browse files
committed
- make handleElement public
- FIX #372
1 parent 15a438e commit b6a2097

File tree

1 file changed

+14
-2
lines changed
  • multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/compose

1 file changed

+14
-2
lines changed

multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/compose/MarkdownExtension.kt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,20 @@ import org.intellij.markdown.MarkdownTokenTypes.Companion.TEXT
2828
import org.intellij.markdown.ast.ASTNode
2929
import org.intellij.markdown.flavours.gfm.GFMElementTypes.TABLE
3030

31+
/**
32+
* Handles the rendering of a markdown element based on its [ASTNode.type].
33+
*
34+
* This function is responsible for determining the appropriate component to use for rendering
35+
* It does handle rendering of children recursively.
36+
*
37+
* @param node The ASTNode representing the markdown element.
38+
* @param components The [MarkdownComponents] instance containing the components to use.
39+
* @param content The original markdown content string.
40+
* @param includeSpacer Whether to include a spacer before rendering the element.
41+
* @param skipLinkDefinition Whether to skip rendering link definitions.
42+
*/
3143
@Composable
32-
internal fun handleElement(
44+
fun MarkdownElement(
3345
node: ASTNode,
3446
components: MarkdownComponents,
3547
content: String,
@@ -75,7 +87,7 @@ internal fun handleElement(
7587

7688
if (!handled) {
7789
node.children.forEach { child ->
78-
handleElement(child, components, content, includeSpacer, skipLinkDefinition)
90+
MarkdownElement(child, components, content, includeSpacer, skipLinkDefinition)
7991
}
8092
}
8193

0 commit comments

Comments
 (0)