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

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

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