class Parser extends ParserBase

Properties

protected array $config from  ParserBase
protected Parser $parser from  ParserBase
protected int $pos
protected array $table
protected Tag $tableTag
protected array[] $tables
protected string $text

Methods

__construct(Parser $parser, array $config)

Constructor

void
setUp()

Plugin's setup

void
parse(string $text, array $matches)

No description

void
addLine(string $line)

Add current line to a table

void
addTableBody()

Process current table's body

void
addTableCell(string $tagName, string $align, string $content)

Add a cell's tags for current table at current position

void
addTableHead()

Process current table's head

void
addTableRow(string $tagName, array $row)

Process given table row

void
captureTables()

Capture all pipe tables in current text

void
createBodyTags(int $startPos, int $endPos)

Create a pair of TBODY tags for given text span

void
createCellTags(string $tagName, int $startPos, int $endPos, string $align)

Create a pair of TD or TH tags for given text span

void
createHeadTags(int $startPos, int $endPos)

Create a pair of THEAD tags for given text span

void
createIgnoreTag(int $pos, int $len)

Create an ignore tag for given text span

void
createRowTags(int $startPos, int $endPos)

Create a pair of TR tags for given text span

void
createSeparatorTag(array $row)

Create an ignore tag for given separator row

void
createTableTags(int $startPos, int $endPos)

Create a pair of TABLE tags for given text span

void
endTable()

End current buffered table

bool
hasValidTable()

Test whether a valid table is currently buffered

bool
isValidSeparator(string $line)

Test whether given line is a valid separator

string
overwriteBlockquoteCallback(array $m)

Overwrite right angle brackets in given match

void
overwriteEscapes()

Overwrite escape sequences in current text

string
overwriteInlineCodeCallback(array $m)

Overwrite backticks in given match

void
overwriteMarkdown()

Overwrite Markdown-style markup in current text

string[]
parseColumnAlignments(string $line)

Parse and return column alignments in given separator line

void
processCurrentTable()

Process current table declaration

void
processTables()

Process all the captured tables

Details

in ParserBase at line 30
final __construct(Parser $parser, array $config)

Constructor

Parameters

Parser $parser
array $config

in ParserBase at line 43
protected void setUp()

Plugin's setup

Return Value

void

at line 42
void parse(string $text, array $matches)

No description

Parameters

string $text
array $matches

If the config array has a "regexp" key, the corresponding matches are passed as second parameter. Otherwise, an empty array is passed

Return Value

void

at line 67
protected void addLine(string $line)

Add current line to a table

Parameters

string $line

Line of text

Return Value

void

at line 93
protected void addTableBody()

Process current table's body

Return Value

void

at line 113
protected void addTableCell(string $tagName, string $align, string $content)

Add a cell's tags for current table at current position

Parameters

string $tagName

Either TD or TH

string $align

Either "left", "center", "right" or ""

string $content

Cell's text content

Return Value

void

at line 141
protected void addTableHead()

Process current table's head

Return Value

void

at line 154
protected void addTableRow(string $tagName, array $row)

Process given table row

Parameters

string $tagName

Either TD or TH

array $row

Return Value

void

at line 177
protected void captureTables()

Capture all pipe tables in current text

Return Value

void

at line 205
protected void createBodyTags(int $startPos, int $endPos)

Create a pair of TBODY tags for given text span

Parameters

int $startPos
int $endPos

Return Value

void

at line 219
protected void createCellTags(string $tagName, int $startPos, int $endPos, string $align)

Create a pair of TD or TH tags for given text span

Parameters

string $tagName

Either TD or TH

int $startPos
int $endPos
string $align

Either "left", "center", "right" or ""

Return Value

void

at line 242
protected void createHeadTags(int $startPos, int $endPos)

Create a pair of THEAD tags for given text span

Parameters

int $startPos
int $endPos

Return Value

void

at line 254
protected void createIgnoreTag(int $pos, int $len)

Create an ignore tag for given text span

Parameters

int $pos
int $len

Return Value

void

at line 266
protected void createRowTags(int $startPos, int $endPos)

Create a pair of TR tags for given text span

Parameters

int $startPos
int $endPos

Return Value

void

at line 277
protected void createSeparatorTag(array $row)

Create an ignore tag for given separator row

Parameters

array $row

Return Value

void

at line 289
protected void createTableTags(int $startPos, int $endPos)

Create a pair of TABLE tags for given text span

Parameters

int $startPos
int $endPos

Return Value

void

at line 299
protected void endTable()

End current buffered table

Return Value

void

at line 314
protected bool hasValidTable()

Test whether a valid table is currently buffered

Return Value

bool

at line 325
protected bool isValidSeparator(string $line)

Test whether given line is a valid separator

Parameters

string $line

Return Value

bool

at line 336
protected string overwriteBlockquoteCallback(array $m)

Overwrite right angle brackets in given match

Parameters

array $m

Return Value

string

at line 346
protected void overwriteEscapes()

Overwrite escape sequences in current text

Return Value

void

at line 360
protected string overwriteInlineCodeCallback(array $m)

Overwrite backticks in given match

Parameters

array $m

Return Value

string

at line 370
protected void overwriteMarkdown()

Overwrite Markdown-style markup in current text

Return Value

void

at line 391
protected string[] parseColumnAlignments(string $line)

Parse and return column alignments in given separator line

Parameters

string $line

Return Value

string[]

at line 417
protected void processCurrentTable()

Process current table declaration

Return Value

void

at line 433
protected void processTables()

Process all the captured tables

Return Value

void