class Crst::BlockParser

Overview

Parses block-level RST elements (paragraphs, lists, tables, quotes, etc.)

Extracted from Parser to handle all non-section, non-explicit-markup block content.

Defined in:

crst/block_parser.cr

Constant Summary

BULLET_CHARS = /[-\*\+]/
ENUM_ALPHA_DOT = /^[a-zA-Z]\.\s+/
ENUM_ALPHA_PAREN = /^[a-zA-Z]\)\s+/
ENUM_DIGIT_DOT = /^\d+\.\s+/
ENUM_DIGIT_PAREN = /^\d+\)\s+/
ENUM_ROMAN_DOT = /^[ivxlcdmIVXLCDM]+\.\s+/
ENUM_ROMAN_PAREN = /^[ivxlcdmIVXLCDM]+\)\s+/
MULTIPLE_SPACES = /\s{2,}/
NON_SPACE_CHAR = /[^ ]/

Constructors

Instance Method Summary

Constructor Detail

def self.new(parser : Parser, config : Config, inline_parser : InlineParser) #

[View source]

Instance Method Detail

def bullet_item?(line : String) : Bool #

[View source]
def dedent_lines(lines : Array(String)) : Array(String) #

[View source]
def enum_item?(line : String) : Bool #

[View source]
def parse_block(lines : Array(String), line_offset : Int32 = 0, allow_sections : Bool = true) : Array(Node) #

Parses a block of lines into nodes This creates a new LineReader for the block context


[View source]
def parse_block_content(reader : LineReader, document : Document) #

[View source]