EmbeddedCodeSpans

laika.parse.code.common.EmbeddedCodeSpans$

Factories for creating a span parser that detects other syntax as part of the span.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def parser(textParser: DelimitedText, embedded: SyntaxHighlighter): Parser[Seq[CodeSpan]]

Creates a new parser for code spans based on the specified parser for delimited text and the embedded "foreign" syntax.

Creates a new parser for code spans based on the specified parser for delimited text and the embedded "foreign" syntax.

An example is a parser for an HTML script element, where the text parser is responsible for detecting the end of the tag (</script>) whereas the embedded syntax is JavaScript, not HTML.

Attributes

def parser(textParser: DelimitedText, embedded: Seq[CodeSpanParser], defaultCategories: Set[CodeCategory]): Parser[Seq[CodeSpan]]

Creates a new parser for code spans based on the specified parser for delimited text and the sequence of code span parsers that detect child spans within that delimited text.

Creates a new parser for code spans based on the specified parser for delimited text and the sequence of code span parsers that detect child spans within that delimited text.

The optional defaultCategories will be assigned to all text that is not recognized by the child span parsers, but part of the delimited string.

An example is a parser for an HTML tag with attributes, where the text parser is responsible for detecting the end of the tag (e.g. /> for an empty tag) whereas the embedded child parsers are responsible for detecting attribute names and values and entity references.

Attributes