console-table-printer icon indicating copy to clipboard operation
console-table-printer copied to clipboard

newlines in cells produce newlines in table

Open lnocera opened this issue 2 years ago • 1 comments

Example:

const p = new Table();
p.addRows([{ col1: 'col1', col2: `col\n2`, col3: 'col3' }]);
p.printTable();

produce:

┌──────┬──────┬──────┐
│ col1 │ col2 │ col3 │
├──────┼──────┼──────┤
│ col1 │ col
2 │ col3 │
└──────┴──────┴──────┘

expect:

┌──────┬──────┬──────┐
│ col1 │ col2 │ col3 │
├──────┼──────┼──────┤
│ col1 │ col2 │ col3 │
│      │ 2    │      │
└──────┴──────┴──────┘

lnocera avatar Jan 29 '23 21:01 lnocera

Considering this an edge case the solution might take some time to implement. But Prs are welcome

ayonious avatar Feb 23 '23 09:02 ayonious

:tada: This issue has been resolved in version 2.12.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

ayonious avatar Jun 20 '24 07:06 ayonious