Skip to content

Commit

Permalink
Fix #109 - Add TaskList plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jeziellago committed Aug 29, 2024
1 parent d674879 commit 35a605a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions markdowntext/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ dependencies {
implementation "io.noties.markwon:ext-tables:$markwon_version"
implementation "io.noties.markwon:html:$markwon_version"
implementation "io.noties.markwon:linkify:$markwon_version"
implementation "io.noties.markwon:ext-tasklist:$markwon_version"

// TODO: Change it after migrating markwon project
implementation "com.github.jeziellago:Markwon:58aa5aba6a"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import io.noties.markwon.SoftBreakAddsNewLinePlugin
import io.noties.markwon.core.MarkwonTheme
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin
import io.noties.markwon.ext.tables.TablePlugin
import io.noties.markwon.ext.tasklist.TaskListPlugin
import io.noties.markwon.html.HtmlPlugin
import io.noties.markwon.image.coil.CoilImagesPlugin
import io.noties.markwon.linkify.LinkifyPlugin
Expand All @@ -35,6 +36,7 @@ internal object MarkdownRender {
.usePlugin(StrikethroughPlugin.create())
.usePlugin(TablePlugin.create(context))
.usePlugin(LinkifyPlugin.create(linkifyMask))
.usePlugin(TaskListPlugin.create(context))
.apply {
if (enableSoftBreakAddsNewLine) {
usePlugin(SoftBreakAddsNewLinePlugin.create())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ class MainActivity : AppCompatActivity() {
.padding(8.dp)
.fillMaxWidth(),
) {
item {
MarkdownText(
markdown = """
- [x] Review #123
- [ ] Complete XYZ
- [ ] Add delight to the experience when all tasks are complete :tada:
""".trimIndent(),
)
}
item {
MarkdownText(
markdown = """
Expand Down

0 comments on commit 35a605a

Please sign in to comment.