Documentation

Parsedown extends Parsedown
in package
uses ParsedownGravTrait

Class Parsedown

Table of Contents

Properties

$completable_blocks  : array<string|int, mixed>
$continuable_blocks  : array<string|int, mixed>
$plugins  : mixed
$excerpts  : Excerpts
$special_chars  : array<string|int, mixed>
$twig_link_regex  : string

Methods

__call()  : mixed|null
For extending this class via plugins
__construct()  : mixed
Parsedown constructor.
__set()  : mixed
addBlockType()  : void
Be able to define a new Block type or override an existing one
addInlineType()  : void
Be able to define a new Inline type or override an existing one
elementToHtml()  : string
Make the element function publicly accessible, Medium uses this to render from Twig
getExcerpts()  : Excerpts
setSpecialChars()  : $this
Setter for special chars
blockTwigTag()  : array<string|int, mixed>|null
Ensure Twig tags are treated as block level items with no <p></p> tags
init()  : void
Initialization function to setup key variables needed by the MarkdownGravLinkTrait
inlineImage()  : array<string|int, mixed>
inlineLink()  : array<string|int, mixed>
inlineSpecialCharacter()  : array<string|int, mixed>|null
isBlockCompletable()  : bool
Overrides the default behavior to allow for plugin-provided blocks to be completable
isBlockContinuable()  : bool
Overrides the default behavior to allow for plugin-provided blocks to be continuable

Properties

protected string $twig_link_regex = '/\!*\[(?:.*)\]\((\{([\{%#])\s*(.*?)\s*(?:\2|\})\})\)/'

Methods

__call()

For extending this class via plugins

public __call(string $method, array<string|int, mixed> $args) : mixed|null
Parameters
$method : string
$args : array<string|int, mixed>
Attributes
#[ReturnTypeWillChange]
Return values
mixed|null

__construct()

Parsedown constructor.

public __construct([Excerpts|PageInterface|null $excerpts = null ][, array<string|int, mixed>|null $defaults = null ]) : mixed
Parameters
$excerpts : Excerpts|PageInterface|null = null
$defaults : array<string|int, mixed>|null = null

__set()

public __set(mixed $name, mixed $value) : mixed
Parameters
$name : mixed
$value : mixed

addBlockType()

Be able to define a new Block type or override an existing one

public addBlockType(string $type, string $tag[, bool $continuable = false ][, bool $completable = false ][, int|null $index = null ]) : void
Parameters
$type : string
$tag : string
$continuable : bool = false
$completable : bool = false
$index : int|null = null

addInlineType()

Be able to define a new Inline type or override an existing one

public addInlineType(string $type, string $tag[, int|null $index = null ]) : void
Parameters
$type : string
$tag : string
$index : int|null = null

elementToHtml()

Make the element function publicly accessible, Medium uses this to render from Twig

public elementToHtml(array<string|int, mixed> $Element) : string
Parameters
$Element : array<string|int, mixed>
Return values
string

markup

setSpecialChars()

Setter for special chars

public setSpecialChars(array<string|int, mixed> $special_chars) : $this
Parameters
$special_chars : array<string|int, mixed>
Return values
$this

blockTwigTag()

Ensure Twig tags are treated as block level items with no <p></p> tags

protected blockTwigTag(array<string|int, mixed> $line) : array<string|int, mixed>|null
Parameters
$line : array<string|int, mixed>
Return values
array<string|int, mixed>|null

init()

Initialization function to setup key variables needed by the MarkdownGravLinkTrait

protected init([PageInterface|Excerpts|null $excerpts = null ][, array<string|int, mixed>|null $defaults = null ]) : void
Parameters
$excerpts : PageInterface|Excerpts|null = null
$defaults : array<string|int, mixed>|null = null

inlineImage()

protected inlineImage(array<string|int, mixed> $excerpt) : array<string|int, mixed>
Parameters
$excerpt : array<string|int, mixed>
Return values
array<string|int, mixed>
protected inlineLink(array<string|int, mixed> $excerpt) : array<string|int, mixed>
Parameters
$excerpt : array<string|int, mixed>
Return values
array<string|int, mixed>

inlineSpecialCharacter()

protected inlineSpecialCharacter(array<string|int, mixed> $excerpt) : array<string|int, mixed>|null
Parameters
$excerpt : array<string|int, mixed>
Return values
array<string|int, mixed>|null

isBlockCompletable()

Overrides the default behavior to allow for plugin-provided blocks to be completable

protected isBlockCompletable(string $Type) : bool
Parameters
$Type : string
Return values
bool

isBlockContinuable()

Overrides the default behavior to allow for plugin-provided blocks to be continuable

protected isBlockContinuable(string $Type) : bool
Parameters
$Type : string
Return values
bool

        
On this page

Search results