Skip to content

If a t tag has no text then the parser throws an error. #46

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

Merged
merged 4 commits into from
Jul 5, 2013
Merged

Conversation

jlward
Copy link
Contributor

@jlward jlward commented Jul 5, 2013

For some word processors (cough abiword cough), it is possible for t tags to have no content. It would look something like this <w:t />.

When we call parse_t we call call self.escape. If you pass None into self.escape an error is thrown. If t.text is None then early return ''

@@ -577,13 +577,13 @@ def _is_style_on(self, el):
return val.lower() not in DISABLED_VALUES

def parse_t(self, el, parsed):
return self.escape(el.text)
return self.escape(el.text or '')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why bother passing an empty string into escape? Does that actually do anything?

@kylegibson-rldatix
Copy link
Collaborator

looks good

jlward added a commit that referenced this pull request Jul 5, 2013
If a t tag has no text then the parser throws an error.
@jlward jlward merged commit 5a49778 into master Jul 5, 2013
jlward pushed a commit that referenced this pull request Mar 14, 2014
jlward pushed a commit that referenced this pull request Mar 14, 2014
jlward pushed a commit that referenced this pull request Mar 14, 2014
jlward added a commit that referenced this pull request Mar 14, 2014
If a t tag has no text then the parser throws an error.
jlward pushed a commit that referenced this pull request Mar 14, 2014
jlward pushed a commit that referenced this pull request Mar 14, 2014
jlward pushed a commit that referenced this pull request Mar 14, 2014
jlward added a commit that referenced this pull request Mar 14, 2014
If a t tag has no text then the parser throws an error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants