Treat ! as operator

Bug: T375935
Change-Id: Iec8e69d28fa3cc32b2c2e87f81707b9fd7af5576
This commit is contained in:
physikerwelt 2024-11-09 08:05:22 +01:00
parent aee95695b8
commit 5cde747b49
No known key found for this signature in database
GPG key ID: FCC793EFFA5FB13C
2 changed files with 7 additions and 0 deletions

View file

@ -16,6 +16,7 @@ class OperatorDictionary {
private static $instance = null;
private const INFIX = [ // Implemented elements have [something, true] for custom parsing
'!' => [ "1, 0, TEXCLASS.CLOSE, null" ], // exclamation mark
'!=' => [ " exports.MO.BIN4" ],
'#' => [ " exports.MO.ORD" ],
'$' => [ " exports.MO.ORD" ],

View file

@ -118,4 +118,10 @@ class LiteralTest extends MediaWikiUnitTestCase {
'| should render as special operator.' );
}
public function testExclamationMark() {
$n = new Literal( '!' );
$this->assertStringContainsString( '!</mo>', $n->renderMML(),
'exclamation mark should render as special operator.' );
}
}