noties / Markwon

Android markdown library (no WebView)
https://noties.io/Markwon/
Apache License 2.0
2.68k stars 298 forks source link

How to disable ListItem (BulletList, OrderedList) #471

Open pennya opened 2 months ago

pennya commented 2 months ago

I would like to know to disable ListItem.

I disabled the list items by referring to the tip area like below

TIP
MarkwonVisitor also allows overriding already registered nodes. For example, you can disable Heading Node rendering:
builder.on(Heading.class, null);

i tried like below.

builder.on(BulletList::class.java, null)
builder.on(OrderedList::class.java, null)
builder.on(ListItem::class.java, null)

original :

hello
1. xxx
2. ccc

expected :

hello
1. xxx
2. ccc

actual :

hello
xxxccc

Is there a way? Thank you in advance.

pennya commented 2 months ago

i found solution like below

override fun configureParser(builder: Parser.Builder) {
    builder.enabledBlockTypes(Collections.emptySet())
}