All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dotty.tools.dottydoc.staticsite.MarkdownCodeBlockVisitor.scala Maven / Gradle / Ivy

There is a newer version: 3.0.0-M1-bin-20201029-1f433d5-NIGHTLY
Show newest version
package dotty.tools
package dottydoc
package staticsite

import com.vladsch.flexmark.util.ast._
import com.vladsch.flexmark.ast._
import com.vladsch.flexmark.util.sequence.CharSubSequence

object MarkdownCodeBlockVisitor {
  def apply(node: Node): Unit =
    new NodeVisitor(
      new VisitHandler(classOf[FencedCodeBlock], new Visitor[FencedCodeBlock] {
        override def visit(node: FencedCodeBlock): Unit = {
          if (node.getOpeningMarker.length == 3)
            node.setOpeningMarker(CharSubSequence.of("```scala"))
        }
      })
    )
    .visit(node)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy