[ODS] multiple space characters are not parsed correctly #835

Closed
opened 2017-10-09 07:29:55 +00:00 by gttds · 2 comments
gttds commented 2017-10-09 07:29:55 +00:00 (Migrated from github.com)

example.zip contains a simple .ODS file which has a text with 3 spaces enclosed in square braces.

SheetJS is not parsing multiple space characters correctly. There should be 3 space characters but it has parsed only 1 space character.

Expected:

> xlsx.utils.sheet_to_csv(ws);
'[   ]\n'

Actual:

> xlsx.utils.sheet_to_csv(ws);
'[ ]\n'
[example.zip](https://github.com/SheetJS/js-xlsx/files/1367744/example.zip) contains a simple .ODS file which has a text with 3 spaces enclosed in square braces. SheetJS is not parsing multiple space characters correctly. There should be 3 space characters but it has parsed only 1 space character. Expected: ``` > xlsx.utils.sheet_to_csv(ws); '[ ]\n' ``` Actual: ``` > xlsx.utils.sheet_to_csv(ws); '[ ]\n' ```
SheetJSDev commented 2017-10-09 15:23:16 +00:00 (Migrated from github.com)

The cell in question has the XML representation

            <text:p>[ <text:s text:c="2"/>]</text:p>

https://github.com/SheetJS/js-xlsx/blob/master/bits/80_parseods.js#L5 removes those tags with the c attribute, but the parameter should be parsed.

The cell in question has the XML representation ```xml <text:p>[ <text:s text:c="2"/>]</text:p> ``` https://github.com/SheetJS/js-xlsx/blob/master/bits/80_parseods.js#L5 removes those tags with the `c` attribute, but the parameter should be parsed.
SheetJSDev commented 2017-10-10 14:06:28 +00:00 (Migrated from github.com)

Thanks a lot! If you are feeling up for it @gttds there are a few other tags encoding whitespace: text:tab and text:line-break. Here is the relevant part from the spec:
ODv12Part1pp120_121.pdf

Thanks a lot! If you are feeling up for it @gttds there are a few other tags encoding whitespace: `text:tab` and `text:line-break`. Here is the relevant part from the spec: [ODv12Part1pp120_121.pdf](https://github.com/SheetJS/js-xlsx/files/1372177/ODv12Part1pp120_121.pdf)
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#835
No description provided.