Converter
in package
implements
ConverterInterface
Converts CommonMark-compatible Markdown to HTML.
Tags
Interfaces, Classes and Traits
- ConverterInterface
- Interface for a service which converts CommonMark to HTML.
Table of Contents
- $docParser : DocParserInterface
- The document parser instance.
- $htmlRenderer : ElementRendererInterface
- The html renderer instance.
- __construct() : mixed
- Create a new commonmark converter instance.
- __invoke() : string
- Converts CommonMark to HTML.
- convertToHtml() : string
- Converts CommonMark to HTML.
Properties
$docParser
The document parser instance.
protected
DocParserInterface
$docParser
$htmlRenderer
The html renderer instance.
protected
ElementRendererInterface
$htmlRenderer
Methods
__construct()
Create a new commonmark converter instance.
public
__construct(DocParserInterface $docParser, ElementRendererInterface $htmlRenderer) : mixed
Parameters
- $docParser : DocParserInterface
- $htmlRenderer : ElementRendererInterface
Return values
mixed —__invoke()
Converts CommonMark to HTML.
public
__invoke(string $commonMark) : string
Parameters
- $commonMark : string
Tags
Return values
string —convertToHtml()
Converts CommonMark to HTML.
public
convertToHtml(string $commonMark) : string
Parameters
- $commonMark : string