ignore comment in the cell. fix #24

This commit is contained in:
chfw 2018-05-23 08:15:54 +01:00
parent 71f4ca1540
commit 6b80080fd2
3 changed files with 10 additions and 2 deletions

View File

@ -88,8 +88,10 @@ class ODSSheet(SheetReader):
paragraphs = cell.getElementsByType(P)
# for each text node
for paragraph in paragraphs:
data = extractText(paragraph)
text_content.append(data)
name_space, tag = paragraph.parentNode.qname
if tag != str('annotation'):
data = extractText(paragraph)
text_content.append(data)
return '\n'.join(text_content)

BIN
tests/fixtures/comment-in-cell.ods vendored Normal file

Binary file not shown.

View File

@ -128,5 +128,11 @@ def test_issue_23():
pe.get_book(url="https://github.com/pyexcel/pyexcel-ods/raw/master/tests/fixtures/white_space.ods"); # flake8: noqa
def test_issue_24():
test_file = get_fixtures("comment-in-cell.ods")
data = get_data(test_file)
print(data)
def get_fixtures(filename):
return os.path.join("tests", "fixtures", filename)