Repository navigation
Conversation
…o default styles defined
…gical padding shorthands
… and support border-spacing
…d re-applying width bounds
…honour authored direction
… and drop dead weight
jsamr
left a comment
There was a problem hiding this comment.
Need to review more, it's quite big. Will review a second time by commit
|
|
||
| function parseSpacing(value: string, node: TNode): BorderSpacing | null { | ||
| const parts = value.split(/\s+/); | ||
| if (parts.length < 1 || parts.length > 2) return null; |
There was a problem hiding this comment.
Which case does parts.length > 2 cover?
There was a problem hiding this comment.
it was guarding against invalid CSS, removed that along with parts.length < 1, which isn't really possible
| return root; | ||
| } | ||
|
|
||
| function parseSpacing(value: string, node: TNode): BorderSpacing | null { |
There was a problem hiding this comment.
Can we be more specific than "value"? Is this a CSS declaration? Inline style value? Let's use the accurate naming from existing specs.
EDIT: from call site context, it should be inlineStyleValue.
| if (name === propertyName) { | ||
| value = declaration | ||
| .slice(colonIndex + 1) | ||
| .replace(/\s*!important\s*$/i, '') |
There was a problem hiding this comment.
Since you're tampering with the value, you"re doing more than a "get... ". that warrants a code comment, and perhaps even a JSDoc depiction since this function is exported.
There was a problem hiding this comment.
Added proper comments
fix: rename getPropertyValue to getInlineStyleValue fix: remove guard conditional from parseSpacing fix: add comments to getPropertyValue
|
@jsamr I addressed all your comments |
I added quite a few new features to the
heuristic-table-plugin:I admit - those were mostly vibe-coded, I was looking at the
ComparisonExampleto compare, how does it perform, briefly checking the code, logic, but not going into too much detailsI also run a few rounds of review-fix for most critical issues, and a few refactor rounds
Not everything is covered (double borders, missing cells), but it was good enough for the project on which I am working, and for which I decided to give it a shot to update it as quick as I can
Here are a couple of iOS screeshots from the example:







And here are android screenshots:





