Skip to content

Underline val of 'none' still triggers the undreline handler #53

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 3 commits into from
Jul 16, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

Changelog
=========
* 0.3.7
* Some inline tags (most notably the underline tag) could have a `val` of
`none` and that would signify that the style is disabled. A `val` of
`none` is now correctly handled.
* 0.3.6
* It is possible for a docx file to not contain a `numbering.xml` file but
still try to use lists. Now if this happens all lists get converted to
Expand Down
2 changes: 1 addition & 1 deletion pydocx/DocxParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
INDENTATION_RIGHT = 'right'
INDENTATION_LEFT = 'left'
INDENTATION_FIRST_LINE = 'firstLine'
DISABLED_VALUES = ['false', '0']
DISABLED_VALUES = ['false', '0', 'none']

# Add some helper functions to Element to make it slightly more readable

Expand Down
11 changes: 10 additions & 1 deletion pydocx/tests/test_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
from pydocx.utils import parse_xml_from_string, find_all


class BoldTestCase(_TranslationTestCase):
class StyleIsOnTestCase(_TranslationTestCase):
expected_output = """
<p><strong>AAA</strong></p>
<p>BBB</p>
<p>CCC</p>
<p>DDD</p>
"""

def get_xml(self):
Expand Down Expand Up @@ -45,6 +46,14 @@ def get_xml(self):
),
],
),
DXB.p_tag(
[
DXB.r_tag(
[DXB.t_tag('DDD')],
rpr=DXB.rpr_tag({'u': 'none'}),
),
],
),
]

body = ''
Expand Down