Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ODF2XHTML throws an error if the document has a footnote or endnote in it #127

Open
derSilberWulf opened this issue Feb 26, 2023 · 0 comments

Comments

@derSilberWulf
Copy link

derSilberWulf commented Feb 26, 2023

ODF2XHTML throws an error if the document has a footnote or endnote in it.

File "\odf\odf2xhtml.py", line 1486, in xhtml
return ''.join(self.lines)
^^^^^^^^^^^^^^^^^^^
TypeError: sequence item 132: expected str instance, int found

self.lines has integers inside it from the numbers used to mark the footnotes.
I was able to get it to work by subclassing ODF2XHTML and overwriting the xhtml method:

def xhtml(self):
       """ Returns the xhtml
       This method was broken in base class so I had to modify it.
       If there were footnotes in the document, self.lines would have integers in it
       and then join would crash the program because it only takes strings
       """
       self.lines = [str(i) for i in self.lines]
       return ''.join(self.lines)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant