abstract class Luce::InlineSyntax
- Luce::InlineSyntax
- Reference
- Object
Overview
Represents one kind of Markdown tag that can be parsed.
Direct Known Subclasses
- Luce::AutolinkExtensionSyntax
- Luce::AutolinkSyntax
- Luce::CodeSyntax
- Luce::EmailAutoLinkSyntax
- Luce::EmojiSyntax
- Luce::EscapeSyntax
- Luce::LineBreakSyntax
- Luce::TagSyntax
- Luce::TextSyntax
Defined in:
luce/inline_parser.crConstructors
-
.new(pattern : String, start_character : Int32 | Nil = nil)
Creates a new
InlineSyntax
which matches text on pattern.
Instance Method Summary
-
#matches?(parser : InlineParser, start_match_pos : Int32 | Nil = nil) : Bool
Tries to match at the parser's current position.
-
#on_match(parser : InlineParser, match : Regex::MatchData) : Bool
Processes match, adding nodes to parser and possibly advancing parser.
- #pattern : Regex
Constructor Detail
def self.new(pattern : String, start_character : Int32 | Nil = nil)
#
Creates a new InlineSyntax
which matches text on pattern.
If start_character is passed, it is used as a pre-matching check which is faster than matching against pattern.
Instance Method Detail
Tries to match at the parser's current position.
The parser's position can be overriden with start_match_pos. Return whether or not the pattern successfully matched.
abstract
def on_match(parser : InlineParser, match : Regex::MatchData) : Bool
#
Processes match, adding nodes to parser and possibly advancing parser.
Will return whether the caller should advance parser by
match[0].size
.