Formatter
class Formatter (View source)
The Formatter parses plain text content and renders it as HTML.
Waterhole uses the TextFormatter library to safely format markup. This class is an abstraction around TextFormatter, enabling extension and caching of its configuration and renderer.
Properties
protected | $configurationCallbacks | ||
protected | $parsingCallbacks | ||
protected | $renderingCallbacks |
Methods
No description
Add a configuration callback to the formatter.
Add a parsing callback to the formatter.
Add a rendering callback to the formatter.
Revert a parsed XML document back into plain text.
Flush the formatter from the cache.
No description
No description
No description
No description
Details
__construct(Filesystem $files, Repository $cache, string $cacheKey)
No description
void
configure(callable $callback)
Add a configuration callback to the formatter.
string
parse(string $text, Context $context = null)
Parse plain text into an XML document for storage in the database.
void
parsing(callable $callback)
Add a parsing callback to the formatter.
string
render(string $xml, Context $context = null)
Transform a parsed XML document into HTML.
void
rendering(callable $callback)
Add a rendering callback to the formatter.
string
unparse(string $xml)
Revert a parsed XML document back into plain text.
void
flush()
Flush the formatter from the cache.
protected Configurator
getConfigurator()
No description
protected
getComponent(string $name)
No description
protected Parser
getParser()
No description
protected Renderer
getRenderer()
No description