mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-13 17:56:59 +00:00
Merge "Add \| to list of special operators"
This commit is contained in:
commit
65f3e1bc95
|
@ -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