Generates ParserOutput from text or removes all tags from a text. More...
Public Member Functions | |
__construct (ParsingPlaceholderFactory $placeholderFactory) | |
containsMarkup (string $text) | |
cleanupTags (string $text) | |
Remove all opening and closing translate tags following the same whitespace rules as the regular parsing. | |
parse (string $text) | |
parseSection (string $text, bool $canWrap) | |
Splits the content marked with <translate> tags into translation units, which are separated with two or more newlines. | |
parseUnit (string $content) | |
Checks if this unit already contains a section marker. | |
armourNowiki (array &$holders, string $text) | |
unarmourNowiki (array $holders, string $text) | |
Generates ParserOutput from text or removes all tags from a text.
Definition at line 15 of file TranslatablePageParser.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePageParser::__construct | ( | ParsingPlaceholderFactory | $placeholderFactory | ) |
Definition at line 18 of file TranslatablePageParser.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePageParser::armourNowiki | ( | array & | $holders, |
string | $text ) |
Definition at line 200 of file TranslatablePageParser.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePageParser::cleanupTags | ( | string | $text | ) |
Remove all opening and closing translate tags following the same whitespace rules as the regular parsing.
This doesn't try to parse the page, so it can handle unbalanced tags.
Definition at line 32 of file TranslatablePageParser.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePageParser::containsMarkup | ( | string | $text | ) |
Definition at line 22 of file TranslatablePageParser.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePageParser::parse | ( | string | $text | ) |
ParsingFailure |
Definition at line 50 of file TranslatablePageParser.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePageParser::parseSection | ( | string | $text, |
bool | $canWrap ) |
Splits the content marked with <translate> tags into translation units, which are separated with two or more newlines.
Extra whitespace is captured in the template and is not included in the translation units.
Definition at line 123 of file TranslatablePageParser.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePageParser::parseUnit | ( | string | $content | ) |
Checks if this unit already contains a section marker.
If there is not, a new one will be created. Marker will have the value of -1, which will later be replaced with a real value.
Definition at line 157 of file TranslatablePageParser.php.
MediaWiki\Extension\Translate\PageTranslation\TranslatablePageParser::unarmourNowiki | ( | array | $holders, |
string | $text ) |
Definition at line 213 of file TranslatablePageParser.php.