Skip to content

Commit

Permalink
Do not decomponse a <t> tag from the xml document because it leaves…
Browse files Browse the repository at this point in the history
… orhpan `<rPr>` tags

Office, Openoffice and Libre are able to open the xlsx but google sheets have a more strict format which does not allow
file corruptions like this
  • Loading branch information
manosprom committed Feb 1, 2024
1 parent f7d85eb commit e18b8ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openformats/formats/xlsx_unstructured.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ def compile(self, template, stringset, **kwargs):
)

if not translation:
t_string.decompose()
t_string.string = ""
continue
t_string.string = translation
replace_string_to.attrs.pop("txid", None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ def test_strings_with_less_tx_tags(self):
template, stringset = xlsx_handler.parse(compiled_file)

self.assert_open_string(
stringset[6], {"string_hash": mock.ANY, "string": "no_tags"}
stringset[6],
{"string_hash": mock.ANY, "string": "<tx>no_tags</tx><tx></tx>"},
)

def test_extract_compile_hyperlink_formulas(self):
Expand Down

0 comments on commit e18b8ca

Please sign in to comment.