HumHub Documentation (unofficial)

LinkTrait

Addes links and images as well as url markers.

This trait conflicts with the HtmlTrait. If both are used together, you have to define a resolution, by defining the HtmlTrait::parseInlineHtml as private so it is not used directly:

use block\HtmlTrait {
    parseInlineHtml as private parseInlineHtml;
}

If the method exists it is called internally by this trait.

Also make sure to reset references on prepare():

protected function prepare()
{
    // reset references
    $this->references = [];
}

Table of Contents

Properties

$references  : array<string|int, mixed>

Methods

consumeReference()  : mixed
Consume link references
identifyReference()  : mixed
lookupReference()  : mixed
parseImage()  : mixed
Parses an image indicated by `![`.
parseInline()  : mixed
parseLink()  : mixed
Parses a link indicated by `[`.
parseLinkOrImage()  : mixed
parseLt()  : mixed
Parses inline HTML.
renderAbsy()  : mixed
renderEmail()  : mixed
renderImage()  : mixed
renderLink()  : mixed
renderUrl()  : mixed
replaceEscape()  : string
Remove backslash from escaped characters

Properties

$references

protected array<string|int, mixed> $references = []

a list of defined references in this document.

Methods

consumeReference()

Consume link references

protected consumeReference(mixed $lines, mixed $current) : mixed
Parameters
$lines : mixed
$current : mixed

identifyReference()

protected identifyReference(mixed $line) : mixed
Parameters
$line : mixed

lookupReference()

protected lookupReference(mixed $key) : mixed
Parameters
$key : mixed

parseImage()

Parses an image indicated by `![`.

protected parseImage(mixed $markdown) : mixed
Parameters
$markdown : mixed
Tags
marker

![

parseInline()

protected abstract parseInline(mixed $text) : mixed
Parameters
$text : mixed

Parses a link indicated by `[`.

protected parseLink(mixed $markdown) : mixed
Parameters
$markdown : mixed
Tags
marker

[

parseLinkOrImage()

protected parseLinkOrImage(mixed $markdown) : mixed
Parameters
$markdown : mixed

parseLt()

Parses inline HTML.

protected parseLt(mixed $text) : mixed
Parameters
$text : mixed
Tags
marker

<

renderAbsy()

protected abstract renderAbsy(mixed $blocks) : mixed
Parameters
$blocks : mixed

renderEmail()

protected renderEmail(mixed $block) : mixed
Parameters
$block : mixed

renderImage()

protected renderImage(mixed $block) : mixed
Parameters
$block : mixed
protected renderLink(mixed $block) : mixed
Parameters
$block : mixed

renderUrl()

protected renderUrl(mixed $block) : mixed
Parameters
$block : mixed

replaceEscape()

Remove backslash from escaped characters

protected replaceEscape(mixed $text) : string
Parameters
$text : mixed
Return values
string

        
On this page

Search results