platform/jewel/markdown/extensions/gfm-strikethrough/README.md
This extension adds support for strikethrough,
a GFM extension over
CommonMark. Strikethrough nodes are parsed by the commonmark-ext-gfm-strikethrough library, and rendered simply by
wrapping their content in a SpanStyle that applies the LineThrough decoration.
To use the strikethrough extension, you need to add the GitHubStrikethroughProcessorExtension to your
MarkdownProcessor, and the
GitHubStrikethroughRendererExtension to the MarkdownBlockRenderer. For example, in standalone mode:
val isDark = JewelTheme.isDark
val markdownStyling = remember(JewelTheme.instanceUuid) {
if (isDark) MarkdownStyling.dark() else MarkdownStyling.light()
}
val processor = remember { MarkdownProcessor(listOf(GitHubStrikethroughProcessorExtension)) }
val blockRenderer =
remember(markdownStyling) {
if (isDark) {
MarkdownBlockRenderer.dark(
styling = markdownStyling,
rendererExtensions = listOf(GitHubStrikethroughRendererExtension),
)
} else {
MarkdownBlockRenderer.light(
styling = markdownStyling,
rendererExtensions = listOf(GitHubStrikethroughRendererExtension),
)
}
}
ProvideMarkdownStyling(markdownStyling, blockRenderer, NoOpCodeHighlighter) {
// Your UI that renders Markdown goes here
}