Skip to content

Commit c77464c

Browse files
author
Jason Ward
committed
refs #29: updated the parser for valid values
1 parent 503b82c commit c77464c

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

pydocx/parsers/Docx2Html.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,7 @@ def head(self):
2424
}
2525

2626
def style(self):
27-
return textwrap.dedent('''<style>.insert{{color:red}}.delete
28-
{{color:red; text-decoration:line-through}}.center
29-
{{text-align:center}}.right{{text-align:right}}
30-
.left{{text-align:left}} .comment{{color:blue}}
31-
body{{width:%(width)spx; margin:0px auto;
32-
}}</style>''') % {
27+
return textwrap.dedent('<style>.insert {color:green;}.delete {color:red;text-decoration:line-through;}.center {text-align:center;}.right {text-align:right;}.left {text-align:left;}.comment {color:blue;}body {width:0px;margin:0px auto;}</style>') % { # noqa
3328
'width': (self.page_width * (4 / 3)),
3429
}
3530
#multiple by (4/3) to get to px
@@ -99,8 +94,9 @@ def list_element(self, text):
9994
}
10095

10196
def ordered_list(self, text, list_style):
102-
return "<ol>%(text)s</ol>" % {
97+
return '<ol list-style-type="%(list_style)s">%(text)s</ol>' % {
10398
'text': text,
99+
'list_style': list_style,
104100
}
105101

106102
def unordered_list(self, text):
@@ -123,7 +119,7 @@ def tab(self):
123119
return '&nbsp&nbsp&nbsp&nbsp'
124120

125121
def table(self, text):
126-
return '<table border=1>' + text + '</table>'
122+
return '<table border="1">' + text + '</table>'
127123

128124
def table_row(self, text):
129125
return '<tr>' + text + '</tr>'

0 commit comments

Comments
 (0)