From f04060e5d9afdd99c768695502d1fc7d17f52bc8 Mon Sep 17 00:00:00 2001 From: emergencyreports <156973723+emergencyreports@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:24:39 -0500 Subject: [PATCH] Change convertToHtml() to convert() because convertToHtml() has been deprecated since commonmark 2.2. --- README.md | 2 +- src/ContentParsers/MarkdownParser.php | 2 +- src/ContentParsers/MarkdownWithFrontMatterParser.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 88f6aba..e5b1db9 100644 --- a/README.md +++ b/README.md @@ -340,7 +340,7 @@ class MarkdownWithFrontMatterParser implements ContentParser return array_merge( $document->matter(), - ['contents' => $this->commonMarkConverter->convertToHtml($document->body())] + ['contents' => $this->commonMarkConverter->convert($document->body())] ); } } diff --git a/src/ContentParsers/MarkdownParser.php b/src/ContentParsers/MarkdownParser.php index 762698f..1d8dd3e 100644 --- a/src/ContentParsers/MarkdownParser.php +++ b/src/ContentParsers/MarkdownParser.php @@ -18,7 +18,7 @@ public function __construct(CommonMarkConverter $commonMarkConverter) public function parse(string $contents): array { - $htmlContents = $this->commonMarkConverter->convertToHtml($contents); + $htmlContents = $this->commonMarkConverter->convert($contents); return [ 'contents' => new HtmlString($htmlContents), diff --git a/src/ContentParsers/MarkdownWithFrontMatterParser.php b/src/ContentParsers/MarkdownWithFrontMatterParser.php index 4b6da19..aae3362 100644 --- a/src/ContentParsers/MarkdownWithFrontMatterParser.php +++ b/src/ContentParsers/MarkdownWithFrontMatterParser.php @@ -21,7 +21,7 @@ public function parse(string $contents): array { $document = YamlFrontMatter::parse($contents); - $htmlContents = $this->commonMarkConverter->convertToHtml($document->body()); + $htmlContents = $this->commonMarkConverter->convert($document->body()); return array_merge( $document->matter(),