Bugfix: Squash warning when determining language in the fenced code block extensions

This commit is contained in:
Starbeamrainbowlabs 2020-06-04 01:42:29 +01:00
parent 90a2a3f6c6
commit 79ddc234d2
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
2 changed files with 5 additions and 1 deletions

View File

@ -26,6 +26,9 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
- Don't worry, we've absorbed all the useful features (see above)
- NOTE TO SELF: Don't forget to update wikimatrix.org when we next make a stable release!
### Fixed
- Squashed a warning when using the fenced code block syntax
## v0.21

View File

@ -1244,7 +1244,8 @@ class PeppermintParsedown extends ParsedownExtra
global $settings;
$result = parent::blockFencedCodeComplete($block);
$language = preg_replace("/^language-/", "", $block["element"]["element"]["attributes"]["class"]);
// Default value: "text"
$language = preg_replace("/^language-/", "", $block["element"]["element"]["attributes"]["class"] ?? "language-text");
if(!isset($settings->parser_ext_renderers->$language))
return $result;