-
Notifications
You must be signed in to change notification settings - Fork 300
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
add column width to TableCell nodes #296
Conversation
The width is determined by the number of dash and colon characters in the separator line of a table, and passed on to the consumer as an integer. This permits consumers of the AST to render tables that are more proportional the width in the source markdown. No changes have been made to the HTML render to make use of the width information, but the test for this feature demonstrates a possible usage. Should a cell be be created that is further to the right than the parsed separator columns are (i.e., when alignment would be null), then the width will be reported as 0.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #296 +/- ##
============================================
+ Coverage 94.28% 94.75% +0.46%
- Complexity 227 254 +27
============================================
Files 124 131 +7
Lines 3625 4135 +510
Branches 549 604 +55
============================================
+ Hits 3418 3918 +500
- Misses 104 108 +4
- Partials 103 109 +6
|
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.
Just one comment, otherwise looks good to merge!
@@ -32,6 +33,17 @@ public void setAlignment(Alignment alignment) { | |||
this.alignment = alignment; | |||
} | |||
|
|||
/** | |||
* @return the cell width |
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.
Can you add a description of what this mean here, similar to the PR description?
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.
I've done that now..
Adds an extra property for column with to
TableCell
nodes.The width is determined by the number of dash and colon characters in the separator line of a table, and passed on to the consumer as an integer. This permits consumers of the AST to render tables that are more proportional the width in the source markdown.
No changes have been made to the HTML render to make use of the width information, but the test for this feature demonstrates a possible usage.
Should a cell be created that is further to the right than the parsed separator columns are (i.e., when alignment would be null), then the width will be reported as 0.