X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FRemexStripTagHandler.php;h=cb85627e1386ff939ec972812cd589d7d15d568c;hb=a1ef77b2d80830fbcb617a83961d78cff9d6e384;hp=bf4c09876d1c6d23ebe8f065f97d1ff5baa14249;hpb=9eafd89011b9b031d902a4381e13254fb67e1e07;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/RemexStripTagHandler.php b/includes/parser/RemexStripTagHandler.php index bf4c09876d..cb85627e13 100644 --- a/includes/parser/RemexStripTagHandler.php +++ b/includes/parser/RemexStripTagHandler.php @@ -9,6 +9,7 @@ use RemexHtml\Tokenizer\Tokenizer; */ class RemexStripTagHandler implements TokenHandler { private $text = ''; + public function getResult() { return $this->text; } @@ -16,15 +17,19 @@ class RemexStripTagHandler implements TokenHandler { 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 ) { // Inject whitespace for typical block-level tags to // prevent merging unrelated
words. @@ -32,6 +37,7 @@ class RemexStripTagHandler implements TokenHandler { $this->text .= ' '; } } + function endTag( $name, $sourceStart, $sourceLength ) { // Inject whitespace for typical block-level tags to // prevent merging unrelated
words. @@ -39,9 +45,11 @@ class RemexStripTagHandler implements TokenHandler { $this->text .= ' '; } } + function doctype( $name, $public, $system, $quirks, $sourceStart, $sourceLength ) { // Do nothing. } + function comment( $text, $sourceStart, $sourceLength ) { // Do nothing. } @@ -87,7 +95,10 @@ class RemexStripTagHandler implements TokenHandler { 'pre' => true, 'section' => true, 'table' => true, + 'td' => true, 'tfoot' => true, + 'th' => true, + 'tr' => true, 'ul' => true, 'video' => true, ];