feat: added getHTMLtoMarkdownOptions func

Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
moonleay 2023-10-15 15:23:41 +02:00
parent 9468efa10d
commit e4a593b7d3

View file

@ -18,6 +18,8 @@
package net.moonleay.rssbot.util
import com.overzealous.remark.IgnoredHtmlElement
import com.overzealous.remark.Options
import dev.kord.common.entity.ButtonStyle
import dev.kord.core.entity.Embed
import dev.kord.rest.builder.component.ActionRowBuilder
@ -141,4 +143,11 @@ object EmbedUtil {
return "https://www.google.com/s2/favicons?domain=${str.split("/")[2]}"
}
fun getHTMLtoMarkdownOptions(): Options {
val o = Options()
o.ignoredHtmlElements.add(IgnoredHtmlElement("img"))
o.inlineLinks = true
return o
}
}