Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
TranslateAnnotationStripper.php
1<?php
2declare( strict_types = 1 );
3
4namespace MediaWiki\Extension\Translate\PageTranslation;
5
6use Wikimedia\Parsoid\Ext\AnnotationStripper;
7
8class TranslateAnnotationStripper implements AnnotationStripper {
9 private TranslatablePageParser $parser;
10
11 public function __construct( TranslatablePageParser $parser ) {
12 $this->parser = $parser;
13 }
14
15 public function stripAnnotations( string $s ): string {
16 return $this->parser->cleanupTags( $s );
17 }
18}
Generates ParserOutput from text or removes all tags from a text.