1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-25 07:41:30 +02:00

Fix issue processwire/processwire-issues#569 when Inputfield::textFormatMarkdown constant used it wasn't replacing default wrapping markup

This commit is contained in:
Ryan Cramer
2018-04-25 09:07:18 -04:00
parent ba400767ab
commit d691b743b0

View File

@@ -434,8 +434,12 @@ class InputfieldWrapper extends Inputfield implements \Countable, \IteratorAggre
foreach(array('error', 'description', 'head', 'notes') as $property) {
$text = $property == 'error' ? $errorsOut : $inputfield->getSetting($property);
if(!empty($text) && !$quietMode) {
$text = nl2br($entityEncodeText ? $inputfield->entityEncode($text, true) : $text);
$text = str_replace('{out}', $text, $markup["item_$property"]);
if($entityEncodeText) {
$text = $inputfield->entityEncode($text, true);
}
if($inputfield->textFormat != Inputfield::textFormatMarkdown) {
$text = str_replace('{out}', nl2br($text), $markup["item_$property"]);
}
} else {
$text = '';
}