dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add parserTests for language converter markup."
[lhc/web/wiklou.git]
/
languages
/
LanguageConverter.php
diff --git
a/languages/LanguageConverter.php
b/languages/LanguageConverter.php
index
79ddb6a
..
96a71a0
100644
(file)
--- a/
languages/LanguageConverter.php
+++ b/
languages/LanguageConverter.php
@@
-1103,6
+1103,7
@@
class LanguageConverter {
* @param $text String: text to armour against conversion
* @return String: armoured text where { and } have been converted to
* { and }
* @param $text String: text to armour against conversion
* @return String: armoured text where { and } have been converted to
* { and }
+ * @deprecated since 1.22 is no longer used
*/
public function armourMath( $text ) {
// convert '-{' and '}-' to '-{' and '}-' to prevent
*/
public function armourMath( $text ) {
// convert '-{' and '}-' to '-{' and '}-' to prevent
@@
-1263,7
+1264,10
@@
class ConverterRule {
$variants = $this->mConverter->mVariants;
$varsep_pattern = $this->mConverter->getVarSeparatorPattern();
$variants = $this->mConverter->mVariants;
$varsep_pattern = $this->mConverter->getVarSeparatorPattern();
+ // Split according to $varsep_pattern, but ignore semicolons from HTML entities
+ $rules = preg_replace( '/(&[#a-zA-Z0-9]+);/', "$1\x01", $rules );
$choice = preg_split( $varsep_pattern, $rules );
$choice = preg_split( $varsep_pattern, $rules );
+ $choice = str_replace( "\x01", ';', $choice );
foreach ( $choice as $c ) {
$v = explode( ':', $c, 2 );
foreach ( $choice as $c ) {
$v = explode( ':', $c, 2 );