diff options
Diffstat (limited to 'ratatoeskr/sys/textprocessors/PlainTextProcessor.php')
-rw-r--r-- | ratatoeskr/sys/textprocessors/PlainTextProcessor.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ratatoeskr/sys/textprocessors/PlainTextProcessor.php b/ratatoeskr/sys/textprocessors/PlainTextProcessor.php new file mode 100644 index 0000000..c8f13f6 --- /dev/null +++ b/ratatoeskr/sys/textprocessors/PlainTextProcessor.php @@ -0,0 +1,22 @@ +<?php + + +namespace r7r\cms\sys\textprocessors; + +use r7r\cms\sys\Esc; + +/** + * A textprocessor that simply escapes the input string. + */ +class PlainTextProcessor implements Textprocessor +{ + public function apply(string $input): string + { + return Esc::esc($input, Esc::HTML_WITH_BR); + } + + public function showInBackend(): bool + { + return true; + } +} |