Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #120 from Respondens/fix-unknown-format-exception
Browse files Browse the repository at this point in the history
Fix github markdown not being mentioned as supported format
  • Loading branch information
deanblackborough authored Apr 10, 2019
2 parents 56bfdbc + fb4b154 commit 2d7db6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 6 additions & 0 deletions src/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
10 changes: 2 additions & 8 deletions src/Render.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 2d7db6a

Please sign in to comment.