class

Luce::TextSyntax

Inherits Luce::InlineSyntax < Reference < Object

Matches stuff that should just be passed through as straight text.

Constructors

new(pattern : String, sub : String = "", start_character : Int32 | Nil = nil, case_sensitive : Bool = true)

Create a new TextSyntax which matches text on pattern.

If sub is passed, it is used as a simple replacement for pattern. If start_character is passed, it is used as a pre-matching check which is faster than matching against pattern.

Instance methods

on_match(parser : InlineParser, match : Regex::MatchData) : Bool

Adds a Text node to parser and returns true if there is a substitute, as long as the preceding character (if any) is not a /.

Otherwise, the parser is advanced by the size of match and false is returned.

substitute