Trait cebe\markdown\inline\LinkTrait

Implemented bycebe\markdown\GithubMarkdown, cebe\markdown\Markdown, cebe\markdown\MarkdownExtra, cebe\markdown\latex\GithubMarkdown, cebe\markdown\latex\Markdown

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 = [];

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$references array A list of defined references in this document. cebe\markdown\inline\LinkTrait

Property Details

$references protected property

A list of defined references in this document.

protected array $references = []

Method Details

consumeReference() protected method

Consume link references

protected void consumeReference ( $lines, $current )
identifyReference() protected method

protected void identifyReference ( $line )
lookupReference() protected method

protected void lookupReference ( $key )
parseImage() protected method

Parses an image indicated by ![.

protected void parseImage ( $markdown )
parseLink() protected method

Parses a link indicated by [.

protected void parseLink ( $markdown )
parseLinkOrImage() protected method

protected void parseLinkOrImage ( $markdown )
parseLt() protected method

Parses inline HTML.

protected void parseLt ( $text )
renderEmail() protected method

protected void renderEmail ( $block )
renderImage() protected method

protected void renderImage ( $block )
renderLink() protected method

protected void renderLink ( $block )
renderUrl() protected method

protected void renderUrl ( $block )