protobi / js-xlsx

XLSX / XLSM / XLSB (Excel 2007+ Spreadsheet) / ODS parser and writer
http://oss.sheetjs.com/js-xlsx
Other
833 stars 416 forks source link

In windows, line breaking not work. #73

Closed shikelong closed 7 years ago

shikelong commented 7 years ago

I insert \r\n in cell value. But The line breaking only work after I click the edit input or double click the cell.

How to mark line breaking work in windows ?


const wbout = XLSX.write(workbook, {bookType: 'xlsx', bookSST: true, type: 'binary'});
  const wblob = new Blob([s2ab(wbout)], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});

gif

pietersv commented 7 years ago

@shikelong Good question. Line breaks would be useful but are not currently implemented in this branch. Line breaks in Excel are trickier as they are written to the XML not as special characters (e.g; \n) but as embedded XML. But if you enter the XML into the string, the special characters get encoded.

If urgent, we can create add this as a micro project. It would likely be 4 billable hours to dev, test and document. contact support@protobi.com.