-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat(table): support align
option
#37
base: main
Are you sure you want to change the base?
feat(table): support align
option
#37
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #37 +/- ##
=======================================
Coverage ? 97.10%
=======================================
Files ? 11
Lines ? 484
Branches ? 139
=======================================
Hits ? 470
Misses ? 12
Partials ? 2 ☔ View full report in Codecov by Sentry. |
src/render.ts
Outdated
@@ -140,6 +140,12 @@ export function codeBlock( | |||
* @group render_utils | |||
*/ | |||
export function table(table: { rows: string[][]; columns: string[] }): string { | |||
const columnLength = table.columns.length; | |||
if (table.rows.some((row) => row.length !== columnLength)) { |
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.
Some rows might have empty leading values in their cells so this can happen
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.
ok, you are right. But if this may cause mistakes that developers are not easy to detect.
I made some new changes. |
align
option
Create md table.
Columns and rows may need to be the same length?Or is this what you expected?