Skip to content

Commit 74b7185

Browse files
author
Jason Ward
committed
refs #24: fixed the justification handler
1 parent 7715041 commit 74b7185

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

pydocx/parsers/Docx2Html.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,17 @@ def page_break(self):
147147
def indent(self, text, just='', firstLine='', left='', right=''):
148148
slug = '<div'
149149
if just:
150-
slug += " class='%(just)s"
150+
slug += " class='%(just)s'"
151151
if firstLine or left or right:
152-
slug += "' style ="
153-
if firstLine:
154-
slug += "'text-indent:%(firstLine)spx;"
155-
if left:
156-
slug += "'margin-left:%(left)spx;"
157-
if right:
158-
slug += "'margin-right:%(right)spx;"
159-
slug += "'>%(text)s</div>"
152+
slug += " style='"
153+
if firstLine:
154+
slug += "text-indent:%(firstLine)spx;"
155+
if left:
156+
slug += "margin-left:%(left)spx;"
157+
if right:
158+
slug += "margin-right:%(right)spx;"
159+
slug += "'"
160+
slug += ">%(text)s</div>"
160161
return slug % {
161162
'text': text,
162163
'just': just,

0 commit comments

Comments
 (0)