Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4120273
UQ.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
UQ.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
MediaWiki\Extension\Math\WikiTexVC\Nodes
;
use
MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmi
;
use
MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmover
;
use
MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmrow
;
use
MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmsup
;
use
MediaWiki\Extension\Math\WikiTexVC\TexUtil
;
class
UQ
extends
TexNode
{
/** @var TexNode */
private
$base
;
/** @var TexNode */
private
$up
;
public
function
__construct
(
TexNode
$base
,
TexNode
$up
)
{
parent
::
__construct
(
$base
,
$up
);
$this
->
base
=
$base
;
$this
->
up
=
$up
;
}
/**
* @return TexNode
*/
public
function
getBase
():
TexNode
{
return
$this
->
base
;
}
/**
* @return TexNode
*/
public
function
getUp
():
TexNode
{
return
$this
->
up
;
}
/** @inheritDoc */
public
function
render
()
{
return
$this
->
base
->
render
()
.
'^'
.
$this
->
up
->
inCurlies
();
}
/** @inheritDoc */
public
function
renderMML
(
$arguments
=
[],
&
$state
=
[]
)
{
$mrow
=
new
MMLmrow
();
$mmlBase
=
new
MMLmsup
();
$base
=
$this
->
getBase
();
$up
=
$this
->
getUp
();
$tu
=
TexUtil
::
getInstance
();
if
(
$base
instanceof
Fun1
&&
$tu
->
over_operator
(
$base
->
getFname
()
)
)
{
$mmlBase
=
new
MMLmover
();
}
// If the superscript has empty elements, render them with empty mi elements to prevent browser issues
$mi
=
new
MMLmi
();
if
(
$base
instanceof
TexArray
&&
$base
->
getLength
()
==
0
)
{
$baseRendered
=
$mi
->
getEmpty
();
}
else
{
$baseRendered
=
$base
->
renderMML
(
$arguments
,
$state
);
}
if
(
$up
instanceof
TexArray
&&
$up
->
getLength
()
==
0
)
{
$upRendered
=
$mi
->
getEmpty
();
}
else
{
// up is inferring a new mrow if it has some content
$upRendered
=
$mrow
->
encapsulateRaw
(
$up
->
renderMML
(
$arguments
,
$state
)
);
}
return
$mmlBase
->
encapsulateRaw
(
$baseRendered
.
$upRendered
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Aug 19, 03:56 (5 d, 16 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
fa/d5/0a1fd3a254f5c1152cae9cd1d2a8
Default Alt Text
UQ.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment