From 0db9b1882d86cf6173dd221e0b97ffc2f623556c Mon Sep 17 00:00:00 2001 From: trendschau Date: Thu, 6 Jan 2022 16:32:17 +0100 Subject: [PATCH] improve shortcode alert text --- system/Extensions/ParsedownExtension.php | 15 +++++++++++---- system/author/css/style.css | 4 ++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/system/Extensions/ParsedownExtension.php b/system/Extensions/ParsedownExtension.php index dbfd3fd..fe2cc5a 100644 --- a/system/Extensions/ParsedownExtension.php +++ b/system/Extensions/ParsedownExtension.php @@ -733,7 +733,7 @@ class ParsedownExtension extends \ParsedownExtra { if ($this->dispatcher && preg_match('/^\[:.*:\]/', $Line['text'], $matches)) { - return $this->createShortcodeArray($matches); + return $this->createShortcodeArray($matches,$block = true); } else { @@ -747,7 +747,7 @@ class ParsedownExtension extends \ParsedownExtra if ($this->dispatcher && preg_match('/\[:.*:\]/', $remainder, $matches)) { - return $this->createShortcodeArray($matches); + return $this->createShortcodeArray($matches, $block = false); } else { @@ -755,7 +755,7 @@ class ParsedownExtension extends \ParsedownExtra } } - protected function createShortcodeArray($matches) + protected function createShortcodeArray($matches, $block) { $shortcodeString = substr($matches[0], 2, -2); $shortcodeArray = explode(' ', $shortcodeString, 2); @@ -787,7 +787,14 @@ class ParsedownExtension extends \ParsedownExtra # if no shortcode has been processed, add the original string if(is_array($html) OR is_object($html)) { - $html = 'No shortcode found.'; + if($block) + { + $html = '

No shortcode found.

'; + } + else + { + $html = 'No shortcode found.'; + } } return array( diff --git a/system/author/css/style.css b/system/author/css/style.css index 0be1efb..42cb0f0 100644 --- a/system/author/css/style.css +++ b/system/author/css/style.css @@ -169,6 +169,10 @@ input.upload{ /* fix wrong text-align/family */ input, textarea, button {font-family: arial, sans-serif} +.shortcode-alert{ + color: red; +} + /**************************** * download-commponent * ****************************/