From fb4b154acd35b9e6158af646fa15c61eefbdb4e9 Mon Sep 17 00:00:00 2001 From: Lode Claassen Date: Mon, 8 Apr 2019 22:21:53 +0200 Subject: [PATCH] fix github markdown not being mentioned as supported format --- src/Options.php | 6 ++++++ src/Render.php | 10 ++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Options.php b/src/Options.php index 49a3dab..f376761 100644 --- a/src/Options.php +++ b/src/Options.php @@ -16,6 +16,12 @@ class Options public const FORMAT_MARKDOWN = 'Markdown'; public const FORMAT_GITHUB_MARKDOWN = 'GithubMarkdown'; // Github flavoured markdown + public const ALL_FORMATS = [ + self::FORMAT_HTML, + self::FORMAT_MARKDOWN, + self::FORMAT_GITHUB_MARKDOWN, + ]; + public const GITHUB_MARKDOWN_TOKEN_STRIKE = '~~'; public const HTML_TAG_BOLD = 'strong'; diff --git a/src/Render.php b/src/Render.php index 8ffe5ca..45b8c76 100644 --- a/src/Render.php +++ b/src/Render.php @@ -46,10 +46,7 @@ public function __construct(string $quill_json, string $format = Options::FORMAT default: throw new \InvalidArgumentException( 'Requested $format not supported, formats supported, ' . - implode( - ', ', - [Options::FORMAT_HTML, OPTIONS::FORMAT_MARKDOWN] - ) + implode(', ', Options::ALL_FORMATS) ); break; } @@ -89,10 +86,7 @@ public function render(bool $trim = false): string // Shouldn't be possible to get here throw new \InvalidArgumentException( 'Requested $format not supported, formats supported, ' . - implode( - ', ', - [Options::FORMAT_HTML, OPTIONS::FORMAT_MARKDOWN] - ) + implode(', ', Options::ALL_FORMATS) ); break; }