forked from SPC/spc-site
Fix MD parser lazy evaluation
This commit is contained in:
parent
bc94e615be
commit
47634fecc5
@ -18,13 +18,16 @@ object SnarkMarkdownParser:SnarkParser<HtmlFragment> {
|
||||
private val markdownFlavor = CommonMarkFlavourDescriptor()
|
||||
private val markdownParser = MarkdownParser(markdownFlavor)
|
||||
|
||||
override suspend fun parse(bytes: ByteArray, meta: Meta): HtmlFragment = {
|
||||
override suspend fun parse(bytes: ByteArray, meta: Meta): HtmlFragment {
|
||||
val src = bytes.decodeToString()
|
||||
div{
|
||||
val parsedTree = markdownParser.buildMarkdownTreeFromString(src)
|
||||
val htmlString = HtmlGenerator(src, parsedTree, markdownFlavor).generateHtml()
|
||||
|
||||
return {
|
||||
div{
|
||||
unsafe {
|
||||
+HtmlGenerator(src, parsedTree, markdownFlavor).generateHtml()
|
||||
+htmlString
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user