Render basic tables and detect them in rules#507
Render basic tables and detect them in rules#507masonium wants to merge 16 commits intodaisy:mainfrom
Conversation
Any thoughts? |
|
Using frame, etc., is a good idea and will work for legacy MathML so we should keep it. However, in MathML core (which is the future), mtable are supposed to be styled with CSS so that info won't likely be around unless it is a local CSS style ( One option is to look at the parent of the table and see if has delimiters around it (parens, brackets, vertical bars, double vertical bars, ???). Comments on the code:
xpath-functions.rs:
mtable.rs:
|
1561464 to
6938e81
Compare
|
I'll try to address everything. For code-specific comments, it's probably easier for both of us to use the commenting feature on Github (pressing the + next to the line numbers on the diffs) so that it's a bit easier to track individual threads.
I'll play around with looking for delimiters.
I wanted to debug some of the functions that take a
It shouldn't be. Fixed.
Fixed. For what it's worth, the existing code also contains some mix of tabs and spaces (see
I adjusted the code so it does a more thorough accounting here, now that I've read the MathML spec and have a reasonable handle on this. One caveat is that, though the spec doesn't seem to fully address it, extra rows that are implied by a dangling The column count is more explicitly defined as the maximum across all rows.
I still need to add these. |
|
I think @NSoiffer 's suggestion about delimeters is good |
|
Apologies for not using the code comment feature. I did this time. In general, it looks much better. The logic is more complicated, so I feel less sure that I can be confident with my review. Adding some more tests, both unit tests with various rowspan/columnspan settings, and some speech tests would add confidence that the code is correct. A few tests for cases when row/columnspan overlap would be very useful since that is a tricky case. |
|
@masonium: if you added some more tests, I didn't see them. |
find rowspan or colspan attributes only on children and grandchildren of mtable element
rowspan and colspan/columnspan are fully handled as dictated by MathML descriptions. Empty rows and cells are properly accounted for.
|
Additional tests have now been added. One of the tests documents the fact that I changed the rule so that it triggers only when it is not immediately preceded by a non-blank operator. If it is, it will fall back to the existing "lines" behavior. I can change the code to instead look for specific delimiters instead, but I'm guessing in practice that a 'table' |
Addresses issue #283 .
This PR adds some internal functions to compute table dimensions (rows and columns) taking
rowspans andcolspans into account, and uses them to render tables with the:arrayintent as "table with m rows and n columns".I'm not super happy with the current logic to detect that an unspecified
mtableshould have an:arrayintent. Right now, it assumes that anymtablethat either renders its frame assolidordashedor has anmrowormtdthat specifies arowspanorcolspanshould be an:array. I think we want something more general, though.