Skip to content

Commit deab193

Browse files
committed
Make over- and under-lines not be accents, so they operate as in actual TeX
1 parent dba2541 commit deab193

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

ts/core/MmlTree/MmlNodes/mo.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,8 @@ export class MmlMo extends AbstractMmlTokenNode {
166166
* whose widths are to be respected (property mathaccent = false)
167167
*/
168168
/* prettier-ignore */
169-
protected static mathaccentsWithWidth = new RegExp([
169+
public static mathaccentsWithWidth = new RegExp([
170170
'^[',
171-
'\u2015', // overline and underline
172171
'\u2190\u2192\u2194', // arrows
173172
'\u23DC\u23DD', // over and under parens
174173
'\u23DE\u23DF', // over and under braces

ts/input/tex/base/BaseMethods.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,9 @@ const BaseMethods: { [key: string]: ParseMethod } = {
845845
{ stretchy: true, accent: true },
846846
entity
847847
);
848-
mo.setProperty('mathaccent', false);
848+
if (entity.match(MmlMo.mathaccentsWithWidth)) {
849+
mo.setProperty('mathaccent', false);
850+
}
849851
const pos = name.charAt(1) === 'o' ? 'over' : 'under';
850852
const base = parser.ParseArg(name);
851853
parser.Push(ParseUtil.underOver(parser, base, mo, pos, stack));

0 commit comments

Comments
 (0)