ilcali.lmxml-markdown_2.8.2.0.1.2.source-code.transform.scala Maven / Gradle / Ivy
package lmxml
package markdown
import com.tristanhunt.knockoff.Discounter
import transforms.{
Transform,
Processor
}
trait MarkdownProcessor extends Processor with Discounter {
def apply(transform: Transform, node: ParsedNode) =
node.children.headOption.map {
case TextNode(s, _, c) =>
TextNode(toXHTML(knockoff(s)).toString, true, c)
// Pass
case head => head
} getOrElse {
TextNode("", children = transform(node.children))
}
}
object DefaultMarkdownProcessor extends MarkdownProcessor
object MarkdownConvert extends Transform("md" -> DefaultMarkdownProcessor)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy