Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 991
Zeile 12... Zeile 12...
12
 */
12
 */
Zeile 13... Zeile 13...
13
 
13
 
Zeile 14... Zeile 14...
14
namespace League\CommonMark;
14
namespace League\CommonMark;
-
 
15
 
15
 
16
use League\CommonMark\Environment\EnvironmentInterface;
16
use League\CommonMark\Environment\EnvironmentInterface;
17
use League\CommonMark\Exception\CommonMarkException;
17
use League\CommonMark\Output\RenderedContentInterface;
18
use League\CommonMark\Output\RenderedContentInterface;
18
use League\CommonMark\Parser\MarkdownParser;
19
use League\CommonMark\Parser\MarkdownParser;
19
use League\CommonMark\Parser\MarkdownParserInterface;
20
use League\CommonMark\Parser\MarkdownParserInterface;
Zeile 49... Zeile 50...
49
     *
50
     *
50
     * @param string $input The Markdown to convert
51
     * @param string $input The Markdown to convert
51
     *
52
     *
52
     * @return RenderedContentInterface Rendered HTML
53
     * @return RenderedContentInterface Rendered HTML
53
     *
54
     *
54
     * @throws \RuntimeException
55
     * @throws CommonMarkException
55
     */
56
     */
56
    public function convert(string $input): RenderedContentInterface
57
    public function convert(string $input): RenderedContentInterface
57
    {
58
    {
58
        $documentAST = $this->markdownParser->parse($input);
59
        $documentAST = $this->markdownParser->parse($input);
Zeile 67... Zeile 68...
67
     *
68
     *
68
     * @param string $markdown The Markdown to convert
69
     * @param string $markdown The Markdown to convert
69
     *
70
     *
70
     * @return RenderedContentInterface Rendered HTML
71
     * @return RenderedContentInterface Rendered HTML
71
     *
72
     *
72
     * @throws \RuntimeException
73
     * @throws CommonMarkException
73
     */
74
     */
74
    public function convertToHtml(string $markdown): RenderedContentInterface
75
    public function convertToHtml(string $markdown): RenderedContentInterface
75
    {
76
    {
76
        \trigger_deprecation('league/commonmark', '2.2.0', 'Calling "convertToHtml()" on a %s class is deprecated, use "convert()" instead.', self::class);
77
        \trigger_deprecation('league/commonmark', '2.2.0', 'Calling "convertToHtml()" on a %s class is deprecated, use "convert()" instead.', self::class);
Zeile 81... Zeile 82...
81
    /**
82
    /**
82
     * Converts CommonMark to HTML.
83
     * Converts CommonMark to HTML.
83
     *
84
     *
84
     * @see MarkdownConverter::convert()
85
     * @see MarkdownConverter::convert()
85
     *
86
     *
86
     * @throws \RuntimeException
87
     * @throws CommonMarkException
87
     */
88
     */
88
    public function __invoke(string $markdown): RenderedContentInterface
89
    public function __invoke(string $markdown): RenderedContentInterface
89
    {
90
    {
90
        return $this->convert($markdown);
91
        return $this->convert($markdown);
91
    }
92
    }