-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix problems with verification and repair of malformed mtables. #779
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm.
I've always been thinking that an alternative to this approach could be to combine all "non-row" elements between rows into a single mtr
.
… than multiple mtr), as requested by Volker. Also, add a removeChild() method to the Node class.
That sounds good. I've pushed commits that does that. See if that is more to your liking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One typo. O/w lgtm.
ts/core/MmlTree/MmlNodes/mtable.ts
Outdated
const isMtd = child.isKind('mtd'); | ||
// | ||
// If there is already an mtr for previous children, just remove the child | ||
// otherwise repalce the child with a new mtr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
This PR produces better results for repairing and reporting issues with malformed mtables. There are verification options available that are supposed to control the error messages produced for bad MathML, and one controls whether tables should be repaired silently or produce
merror
elements to report the problem. ThefixMtables
option did not work well, as it did not produce proper messages in some cases, and didn't always produce a repaired table.The fixes here include:
void
but returned anerror
node).mtr
ormtd
elements are in a validmtable
, and produce the right output (a coloredmtd
when used outside anmtr
, or a coloredmtr
when used outside a table, and a colored entry when missing themtd
.mtr
andmtd
elements are inserted to make a valid table regardless of the verification options (those only control the error reporting).