summaryrefslogtreecommitdiff
path: root/www/wiki/includes/parser/RemexStripTagHandler.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/includes/parser/RemexStripTagHandler.php')
-rw-r--r--www/wiki/includes/parser/RemexStripTagHandler.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/www/wiki/includes/parser/RemexStripTagHandler.php b/www/wiki/includes/parser/RemexStripTagHandler.php
new file mode 100644
index 00000000..2839147d
--- /dev/null
+++ b/www/wiki/includes/parser/RemexStripTagHandler.php
@@ -0,0 +1,40 @@
+<?php
+
+use RemexHtml\Tokenizer\Attributes;
+use RemexHtml\Tokenizer\TokenHandler;
+use RemexHtml\Tokenizer\Tokenizer;
+
+/**
+ * @internal
+ */
+class RemexStripTagHandler implements TokenHandler {
+ private $text = '';
+ public function getResult() {
+ return $this->text;
+ }
+
+ function startDocument( Tokenizer $t, $fns, $fn ) {
+ // Do nothing.
+ }
+ function endDocument( $pos ) {
+ // Do nothing.
+ }
+ function error( $text, $pos ) {
+ // Do nothing.
+ }
+ function characters( $text, $start, $length, $sourceStart, $sourceLength ) {
+ $this->text .= substr( $text, $start, $length );
+ }
+ function startTag( $name, Attributes $attrs, $selfClose, $sourceStart, $sourceLength ) {
+ // Do nothing.
+ }
+ function endTag( $name, $sourceStart, $sourceLength ) {
+ // Do nothing.
+ }
+ function doctype( $name, $public, $system, $quirks, $sourceStart, $sourceLength ) {
+ // Do nothing.
+ }
+ function comment( $text, $sourceStart, $sourceLength ) {
+ // Do nothing.
+ }
+}