Skip to content

Commit

Permalink
Fix regression with tables due to #1146
Browse files Browse the repository at this point in the history
  • Loading branch information
dpvc committed Nov 24, 2024
1 parent b5c184b commit 5de3359
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ts/core/MmlTree/MmlNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,14 @@ export abstract class AbstractMmlNode
delete attributes[key];
}
}
this.attributes.setInherited('displaystyle', display);
this.attributes.setInherited('scriptlevel', level);
const displaystyle = this.attributes.getExplicit('displaystyle');
if (displaystyle === undefined) {
this.attributes.setInherited('displaystyle', display);
}
const scriptlevel = this.attributes.getExplicit('scriptlevel');
if (scriptlevel === undefined) {
this.attributes.setInherited('scriptlevel', level);
}
if (prime) {
this.setProperty('texprimestyle', prime);
}
Expand Down
14 changes: 14 additions & 0 deletions ts/core/MmlTree/MmlNodes/mstyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ export class MmlMstyle extends AbstractMmlLayoutNode {
return this.childNodes[0] && this.childNodes[0].childNodes.length === 1;
}

/**
* @override
*/
public setInheritedAttributes(
attributes: AttributeList = {},
display: boolean = false,
level: number = 0,
prime: boolean = false
) {
this.attributes.setInherited('displaystyle', display);
this.attributes.setInherited('scriptlevel', level);
super.setInheritedAttributes(attributes, display, level, prime);
}

/**
* Handle scriptlevel changes, and add mstyle attributes to the ones being inherited.
*
Expand Down

0 comments on commit 5de3359

Please sign in to comment.