$filters
$filters :
Supported filters.
Filter and format content.
wrapElementWithStartEnd(string $text, string $tag, string $start, string $end, \Anax\TextFilter\number $count) : array
Wrap HTML element with with start and end.
| string | $text | with content |
| string | $tag | HTML tag to search for |
| string | $start | wrap start part |
| string | $end | wrap end part |
| \Anax\TextFilter\number | $count | hits to search for |
with text and boolean if more was detected.
wrapElementContentWithStartEnd(string $text, string $tag, string $start, string $end, \Anax\TextFilter\number $count) : array
Wrap content of a HTML element with start and end.
| string | $text | with content |
| string | $tag | HTML tag to search for |
| string | $start | wrap start part |
| string | $end | wrap end part |
| \Anax\TextFilter\number | $count | hits to search for |
with text and boolean if more was detected.
createToc(string $text, integer $start = 2, integer $stop = 4) : array
Create a TOC of HTML headings from and to a certain level.
| string | $text | with content |
| integer | $start | level of headings to use for toc. |
| integer | $stop | level of headings to use for toc. |
with entries to generate a TOC.
createAnchor4Header(string $text, integer $start = 1, integer $stop = 4) : string
Create a anchor for each header having an id.
| string | $text | with content |
| integer | $start | level of headings to use. |
| integer | $stop | level of headings to use. |
with modified text.
addBaseurlToRelativeLinks(string $text, string $baseurl, callable $callback) : string
Add baseurl to all relative links.
| string | $text | with content. |
| string | $baseurl | as string to prepend relative link. |
| callable | $callback | Use to create url from route. |
with modified text.
addBaseurlToImageSource(string $text, string $baseurl, callable $callback) : string
Add baseurl to all relative links in image source.
| string | $text | with content. |
| string | $baseurl | as string to prepend relative link. |
| callable | $callback | Use to create url from route. |
with modified text.
addRevisionHistory(string $text, array $revision, string $start, string $end, string $class, string $source = null) : string
Generate revision history and add to the end of content.
| string | $text | with content. |
| array | $revision | with all revisions. |
| string | $start | start wrap with this. |
| string | $end | end wrap with this. |
| string | $class | to add to ul element. |
| string | $source | optional url to document source. |
with text and optionally added revision history.
setMeta(array $meta) : void
Set meta information that some filters can use.
| array | $meta | values for filters to use. |
| None found |
getFilters() : array
Return an array of all filters supported.
with strings of filters supported.
| None found |
hasFilter(string $filter) : boolean
Check if filter is supported.
| string | $filter | to use. |
when filter does not exists.
true if filter exists, false othwerwise.
| None found |
parse(string $text, array $filter) : array
Call each filter and return array with details of the formatted content.
| string | $text | the text to filter. |
| array | $filter | array of filters to use. |
when filterd does not exists.
with the formatted text and additional details.
| None found |
addExcerpt( $current) : \Anax\TextFilter\void.
Add excerpt as short version of text if available.
| $current |
| None found |
jsonFrontMatter(string $text) : array
Extract JSON front matter from text.
| string | $text | the text to be parsed. |
with the formatted text and the front matter.
| None found |
yamlFrontMatter(string $text) : array
Extract YAML front matter from text.
| string | $text | the text to be parsed. |
with the formatted text and the front matter.
| None found |
yamlParse(string $text) : array
Extract YAML front matter from text, use one of several available implementations of a YAML parser.
| string | $text | the text to be parsed. |
Exception when parsing frontmatter fails.
with the formatted text and the front matter.
| None found |
getTitleFromFirstH1(string $text) : string|null
Get the title from the first H1.
| string | $text | the text to be parsed. |
with the title, if its found.
| None found |
getTitleFromFirstHeader(string $text) : string|null
Get the title from the first header.
| string | $text | the text to be parsed. |
with the title, if its found.
| None found |
bbcode2html(string $text) : string
Helper, BBCode formatting converting to HTML.
| string | $text | The text to be converted. |
the formatted text.
| None found |
makeClickable(string $text) : string
Make clickable links from URLs in text.
| string | $text | the text that should be formatted. |
with formatted anchors.
| None found |
syntaxHighlightJs(string $text, string $language = "text") : string
Syntax highlighter using highlight.php, a port of highlight.js https://packagist.org/packages/scrivo/highlight.php.
| string | $text | text to be converted. |
| string | $language | which language to use for highlighting syntax. |
the formatted text.
| None found |
purify(string $text) : string
Format text according to HTML Purifier.
| string | $text | that should be formatted. |
as the formatted html-text.
| None found |
markdown(string $text) : string
Format text according to Markdown syntax.
| string | $text | the text that should be formatted. |
as the formatted html-text.
| None found |
nl2br(string $text) : string
For convenience access to nl2br
| string | $text | text to be converted. |
the formatted text.
| None found |
htmlentities(string $text) : string
For convenience access to htmlentities
| string | $text | text to be converted. |
the formatted text.
| None found |
addToFrontmatter(array|null $matter) : $this
Add array items to frontmatter.
| array|null | $matter | key value array with items to add or null if empty. |
| None found |
parseFactory(string $filter) : string
Call a specific filter and store its details.
| string | $filter | to use. |
when filter does not exists.
the formatted text.
| None found |
extractFrontMatter(string $text, string $startToken, string $stopToken) : array
Extract front matter from text.
| string | $text | the text to be parsed. |
| string | $startToken | the start token. |
| string | $stopToken | the stop token. |
with the formatted text and the front matter.
| None found |