class Formatter

Properties

protected $configurationCallbacks
protected $parsingCallbacks
protected $unparsingCallbacks
protected $renderingCallbacks

Methods

__construct(Repository $cache, string $cacheDir)

No description

void
addConfigurationCallback(callable $callback)

No description

void
addParsingCallback(callable $callback)

No description

void
addUnparsingCallback(callable $callback)

No description

void
addRenderingCallback(callable $callback)

No description

string
parse(string $text, mixed $context = null, User $user = null)

No description

string
render(string $xml, mixed $context = null, ServerRequestInterface $request = null)

No description

string
unparse(string $xml, mixed $context = null)

No description

void
flush()

<p>Flush the cache so that the formatter components are regenerated.</p>

Configurator
getConfigurator()

No description

void
configureExternalLinks(Configurator $configurator)

No description

mixed
getComponent(string $name)

<p>Get a TextFormatter component (&quot;renderer&quot; or &quot;parser&quot; or &quot;js&quot;).</p>

Parser
getParser(mixed $context = null)

No description

Renderer
getRenderer()

No description

string
getJs()

<p>Get the formatter JavaScript.</p>

string
configureDefaultsOnLinks(string $xml)

No description

string
convert(string|null $content)

<p>Converts a plain text string (with or without Markdown) to it's HTML equivalent.</p>

Details

__construct(Repository $cache, string $cacheDir)

Parameters

Repository $cache
string $cacheDir

void addConfigurationCallback(callable $callback)

Parameters

callable $callback

Return Value

void

void addParsingCallback(callable $callback)

Parameters

callable $callback

Return Value

void

void addUnparsingCallback(callable $callback)

Parameters

callable $callback

Return Value

void

void addRenderingCallback(callable $callback)

Parameters

callable $callback

Return Value

void

string parse(string $text, mixed $context = null, User $user = null)

Parameters

string $text
mixed $context
User $user

Return Value

string

string render(string $xml, mixed $context = null, ServerRequestInterface $request = null)

Parameters

string $xml
mixed $context
ServerRequestInterface $request

Return Value

string

string unparse(string $xml, mixed $context = null)

Parameters

string $xml
mixed $context

Return Value

string

void flush()

<p>Flush the cache so that the formatter components are regenerated.</p>

Return Value

void

protected Configurator getConfigurator()

Return Value

Configurator

Parameters

Configurator $configurator

Return Value

void

protected mixed getComponent(string $name)

<p>Get a TextFormatter component (&quot;renderer&quot; or &quot;parser&quot; or &quot;js&quot;).</p>

Parameters

string $name

Return Value

mixed

protected Parser getParser(mixed $context = null)

Parameters

mixed $context

Return Value

Parser

protected Renderer getRenderer()

Return Value

Renderer

string getJs()

<p>Get the formatter JavaScript.</p>

Return Value

string

Parameters

string $xml

Return Value

string

string convert(string|null $content)

<p>Converts a plain text string (with or without Markdown) to it's HTML equivalent.</p>

Parameters

string|null $content

Return Value

string