commonMain.moe.tlaster.ktml.Ktml.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ktml-jvm Show documentation
Show all versions of ktml-jvm Show documentation
Html parser for Kotlin Multiplatform
package moe.tlaster.ktml
import moe.tlaster.ktml.dom.Element
import moe.tlaster.ktml.parser.SimpleParser
import moe.tlaster.ktml.parser.StringReader
import moe.tlaster.ktml.parser.Tokenizer
import moe.tlaster.ktml.parser.token.Token
object Ktml {
internal fun tokenize(text: String): List {
val reader = StringReader(text)
val tokenizer = Tokenizer()
tokenizer.parse(reader)
return tokenizer.tokens
}
fun parse(text: String): Element {
val tokens = tokenize(text)
return SimpleParser.parse(tokens)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy