mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-27 17:01:07 +00:00
Add \| to list of special operators
Bug: T376546 Change-Id: Ibf57c995c2381fea095600c31ce6432a1e8fd4fd
This commit is contained in:
parent
cebab4fc89
commit
ca10252923
|
@ -166,7 +166,7 @@ class MMLutil {
|
|||
if ( str_starts_with( $input, "\\" ) && strlen( $input ) >= 2 ) {
|
||||
$input = substr( $input, 1 );
|
||||
// These are edge cases where input can be a Literal OR an Operator
|
||||
$edgeCases = [ "S", "P", ";", ",", "!", "'", ">" ];
|
||||
$edgeCases = [ "S", "P", ";", ",", "!", "'", ">", "|" ];
|
||||
if ( in_array( $input, $edgeCases, true ) ) {
|
||||
$input = "\\" . $input;
|
||||
}
|
||||
|
|
|
@ -94,4 +94,10 @@ class LiteralTest extends MediaWikiUnitTestCase {
|
|||
'hboxes should not be wrapped in to mi elements.' );
|
||||
}
|
||||
|
||||
public function testDoubleVerticalLine() {
|
||||
$n = new Literal( '\\|' );
|
||||
$this->assertStringContainsString( '‖</mo>', $n->renderMML(),
|
||||
'double vertical line should render as special operator.' );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue