aboutsummaryrefslogtreecommitdiff
path: root/ratatoeskr/sys/textprocessors/MarkdownProcessor.php
diff options
context:
space:
mode:
Diffstat (limited to 'ratatoeskr/sys/textprocessors/MarkdownProcessor.php')
-rw-r--r--ratatoeskr/sys/textprocessors/MarkdownProcessor.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/ratatoeskr/sys/textprocessors/MarkdownProcessor.php b/ratatoeskr/sys/textprocessors/MarkdownProcessor.php
new file mode 100644
index 0000000..15f2f48
--- /dev/null
+++ b/ratatoeskr/sys/textprocessors/MarkdownProcessor.php
@@ -0,0 +1,22 @@
+<?php
+
+
+namespace r7r\cms\sys\textprocessors;
+
+use Michelf\Markdown;
+
+/**
+ * A textprocessor that uses markdown to generate HTML.
+ */
+class MarkdownProcessor implements Textprocessor
+{
+ public function apply(string $input): string
+ {
+ return Markdown::defaultTransform($input);
+ }
+
+ public function showInBackend(): bool
+ {
+ return true;
+ }
+}