Skip to content

Commit 1adddfe

Browse files
authored
Merge commit from fork
encode the prefix and suffix and run them via markdown
2 parents f1d5ea6 + feed6b0 commit 1adddfe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/fields/Number.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
use craft\fields\conditions\NumberFieldConditionRule;
1919
use craft\gql\types\Number as NumberType;
2020
use craft\helpers\Db;
21+
use craft\helpers\Html;
2122
use craft\helpers\Localization;
2223
use craft\i18n\Locale;
2324
use GraphQL\Type\Definition\Type;
2425
use Throwable;
2526
use yii\base\InvalidArgumentException;
2627
use yii\db\Schema;
28+
use yii\helpers\Markdown;
2729

2830
/**
2931
* Number represents a Number field.
@@ -383,11 +385,11 @@ public function getPreviewHtml(mixed $value, ElementInterface $element): string
383385
};
384386

385387
if ($this->prefix) {
386-
$formatted = $this->prefix . $formatted;
388+
$formatted = Markdown::processParagraph(Html::encode($this->prefix)) . $formatted;
387389
}
388390

389391
if ($this->suffix) {
390-
$formatted = $formatted . $this->suffix;
392+
$formatted = $formatted . Markdown::processParagraph(Html::encode($this->suffix));
391393
}
392394

393395
return $formatted;

0 commit comments

Comments
 (0)