diff --git a/CHANGELOG b/CHANGELOG index f009a3b9..17808c30 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/pydocx/DocxParser.py b/pydocx/DocxParser.py index fd16308f..5608c504 100644 --- a/pydocx/DocxParser.py +++ b/pydocx/DocxParser.py @@ -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 diff --git a/pydocx/tests/test_xml.py b/pydocx/tests/test_xml.py index 8142ef2b..84e2c697 100644 --- a/pydocx/tests/test_xml.py +++ b/pydocx/tests/test_xml.py @@ -12,11 +12,12 @@ from pydocx.utils import parse_xml_from_string, find_all -class BoldTestCase(_TranslationTestCase): +class StyleIsOnTestCase(_TranslationTestCase): expected_output = """

AAA

BBB

CCC

+

DDD

""" def get_xml(self): @@ -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 = ''