1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-06 05:07:41 +02:00

feat(directives): add ability to disable textile using !textile

This commit is contained in:
Awilum
2022-09-13 10:16:05 +03:00
parent aa05d15bc9
commit 4a53e994e1

View File

@@ -36,6 +36,10 @@ emitter()->addListener('onEntriesFetchSingleField', static function (): void {
$field = entries()->registry()->get('methods.fetch.field');
if (is_string($field['value']) && strings($field['value'])->contains('!textile')) {
return;
}
if (is_string($field['value'])) {
if (strings($field['value'])->contains('@textile')) {
$field['value'] = strings(parsers()->textile()->parse($field['value']))->replace('@textile', '')->trim()->toString();