Center justified and pushed in from left and it is
great and it is the coolest thing of all time and I like it and
I think it is cool
+
Left justified and pushed in from left
''')
diff --git a/pydocx/tests/test_xml.py b/pydocx/tests/test_xml.py
index 8b6d04aa..405e5981 100644
--- a/pydocx/tests/test_xml.py
+++ b/pydocx/tests/test_xml.py
@@ -716,3 +716,31 @@ def get_xml(self):
xml = DXB.xml(body)
return xml
+
+
+class TestCase(_TranslationTestCase):
+ expected_output = '''
+
+
+ - AAA
+
+
BBB
+
+ '''
+
+ numbering_dict = {
+ '1': {
+ '0': 'lowerLetter',
+ }
+ }
+
+ def get_xml(self):
+ li = DXB.li(text='AAA', ilvl=0, numId=1)
+ p_tags = [
+ DXB.p_tag('BBB'),
+ ]
+ body = li
+ for p_tag in p_tags:
+ body += p_tag
+ xml = DXB.xml(body)
+ return xml
From cdaed19a041a9103e9510540d17d2403b00515ef Mon Sep 17 00:00:00 2001
From: Jason Ward
Date: Thu, 16 May 2013 15:44:18 -0400
Subject: [PATCH 2/5] refs #24: fixed the justification handler
---
pydocx/parsers/Docx2Html.py | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/pydocx/parsers/Docx2Html.py b/pydocx/parsers/Docx2Html.py
index 87b8ed49..f97e39be 100644
--- a/pydocx/parsers/Docx2Html.py
+++ b/pydocx/parsers/Docx2Html.py
@@ -147,16 +147,17 @@ def page_break(self):
def indent(self, text, just='', firstLine='', left='', right=''):
slug = '%(text)s
"
+ slug += " style='"
+ if firstLine:
+ slug += "text-indent:%(firstLine)spx;"
+ if left:
+ slug += "margin-left:%(left)spx;"
+ if right:
+ slug += "margin-right:%(right)spx;"
+ slug += "'"
+ slug += ">%(text)s"
return slug % {
'text': text,
'just': just,
From 371754add55f62701b26f5f0d1a85290d3f0256d Mon Sep 17 00:00:00 2001
From: Jason Ward