diff --git a/README.md b/README.md index b4453cf8..91bd33e3 100644 --- a/README.md +++ b/README.md @@ -113,8 +113,7 @@ DocxParser includes abstracts methods that each parser overwrites to satsify its @abstractmethod def table(self, text): - return text - + return text @abstractmethod def table_row(self, text): return text @@ -161,4 +160,16 @@ OR, let's say FOO is your new favorite markup language. Simply customize your ow def linebreak(self): return '!!!!!!!!!!!!' # because linebreaks in are denoted by '!!!!!!!!!!!!' - # with the FOO markup langauge :) \ No newline at end of file + # with the FOO markup langauge :) + +#Styles + +The base parser `Docx2Html` relies on certain css class being set for certain behaviour to occur. Currently these include: + +* class `insert` -> Turns the text green. +* class `delete` -> Turns the text red and draws a line through the text. +* class `center` -> Aligns the text to the center. +* class `right` -> Aligns the text to the right. +* class `left` -> Aligns the text to the left. +* class `comment` -> Turns the text blue. +* class `pydocx-underline` -> Underlines the text. diff --git a/pydocx/parsers/Docx2Html.py b/pydocx/parsers/Docx2Html.py index f97e39be..9aa78354 100644 --- a/pydocx/parsers/Docx2Html.py +++ b/pydocx/parsers/Docx2Html.py @@ -9,9 +9,6 @@ class Docx2Html(DocxParser): @property def parsed(self): content = self._parsed - content = content.replace('
', '', '
') - content = content.replace('
This sentence has some bold, some italics and some underline, as well as a hyperlink.
''') # noqa + assert_html_equal(actual_html, ( + 'This sentence has some bold, ' + 'some italics and some ' + 'underline, ' + 'as well as a hyperlink' + '.
' + )) def test_unicode(): @@ -639,16 +644,16 @@ def test_shift_enter(): actual_html = convert(file_path) assert_html_equal(actual_html, ''' -AAA
BBB
AAA
BBB
CCC
GGG HHH |
- III JJJ |
+ GGG HHH |
+ III JJJ |
|||
KKK | @@ -767,7 +772,7 @@ def test_simple_table(): assert_html_equal(actual_html, '''
Cell1 Cell3 | Cell2 + |
Cell1 Cell3 | Cell2 And I am writing in the table |
Cell4 |
AAA
+AAA
BBB
""" @@ -121,7 +121,7 @@ class HyperlinkWithBreakTestCase(_TranslationTestCase): expected_output = ''' - + ''' @@ -382,7 +382,7 @@ class TableWithListAndParagraph(_TranslationTestCase):