Repository navigation
Conversation
Owner
|
Thanks @s1reyash! |
privateOmega
left a comment
Owner
There was a problem hiding this comment.
Thanks, this works. I ran it merged with current develop: border: 0, border: none and border: 0px on a table and its cells now give no borders, where develop wrote w:sz="0" single borders. border: 1px solid red is unchanged. Typecheck, lint and all tests pass.
One thing before it can merge:
- Formatting:
pnpm exec oxfmt --check .fails onsrc/helpers/xml-builder/fixups.ts(the longstroke = …line).pnpm formatfixes it. CI hasn't run on this PR yet because it's from a fork; it will after this push.
Optional, but nice:
- An end-to-end test next to the unit tests, e.g. converting
<table style="border: 0"><tr><td>a</td></tr></table>and checking the document has no<w:tblBorders>sides with a width. That locks in the user-visible behaviour from #52, not just the parser.
(#177 is a different bug: continued cells of a rowspan get default borders. So this PR shouldn't close it, which matches your Fixes #52.)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cssBorderParserinsrc/helpers/xml-builder/fixups.tsto parse unit-less0andnoneas[0, 'none', undefined]and unit-less numeric widths as pixel values.table.tssoborder: 0/border: '0'is preserved (not overridden by the defaultborderSize = 2via||) on both tables and table cells.tests/table-border.test.js.Verification
npm test: 10 test files passedFixes #52