class Markdown (View source)

Constants

BLOCKQUOTE

CODE_BLOCK

H1

H2

H3

H4

H5

H6

HR

ANCHOR

ANCHOR_TITLE

FIGURE

FIGURE_CAPTION

OL

UL

BOLD

CODE

ITALIC

STRIKETHROUGH

TABLE

TASK

TASK_DONE

SUBSCRIPT

SUPERSCRIPT

Methods

__construct(bool $enableCustom = true)

No description

enableErrors(bool $enable)

Enable/disable parse errors

enableHtml(bool $enable)

Enable/disable use HTML in markdown body

setTemplate(int $type, string $template)

Set HTML template

setCustomInline(string $delimiter, string $template)

Set custom inline HTML template

string
fromString(string $input)

Convert a markdown string into an HTML string with paragraphs

string
fromInlineString(string $input)

Convert a markdown string into an HTML string (inline) without paragraphs

string
fromFile(string $path)

Convert a markdown file into an HTML string with paragraphs

Details

__construct(bool $enableCustom = true)

No description

Parameters

bool $enableCustom

Enable/disable non-standard inline syntaxes:

  • !!highlight!! -> highlight
  • %%variable%% -> variable
  • ++inserted++ -> inserted
  • --deleted-- -> deleted

enableErrors(bool $enable)

Enable/disable parse errors

Parameters

bool $enable

enableHtml(bool $enable)

Enable/disable use HTML in markdown body

Parameters

bool $enable

setTemplate(int $type, string $template)

Set HTML template

Parameters

int $type
string $template

setCustomInline(string $delimiter, string $template)

Set custom inline HTML template

Parameters

string $delimiter
string $template

string fromString(string $input)

Convert a markdown string into an HTML string with paragraphs

Parameters

string $input

Return Value

string

Exceptions

Exception

string fromInlineString(string $input)

Convert a markdown string into an HTML string (inline) without paragraphs

Parameters

string $input

Return Value

string

Exceptions

Exception

string fromFile(string $path)

Convert a markdown file into an HTML string with paragraphs

Parameters

string $path

Return Value

string

Exceptions

Exception