-
Notifications
You must be signed in to change notification settings - Fork 56
Stop using deprecated tags #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
def underline(self, text): | ||
return '<u>' + text + '</u>' | ||
return '<span style="text-decoration: underline">' + text + '</span>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than I direct style declaration, I think you would be better off by defining a set of CSS classes that pydocx will add to indicate things like this. Changing how those classes affect the output would be much easier than trying to strip out styles.
So how about class="pydocx-underline"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, for this pull request, you'll need to add a section to the readme about css classes used by the default HTML formatter that includes this.
@@ -9,9 +9,6 @@ class Docx2Html(DocxParser): | |||
@property | |||
def parsed(self): | |||
content = self._parsed | |||
content = content.replace('<p></p><p></p>', '<br />') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we want to do this with PolicyStat. Is this already done somewhere else, or should it be added to your transition document?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was not really working very well to begin with. Really it should have been called in a loop until the html stopped changing. I believe that the semantinator handles some of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Added that to your transition document.
Looks good |
u
,i
, andb
are all deprecated. Use<span style="text-decoration: underline;">
,em
, andstrong
instead.In addition, all self closing tags should be in the form
<%s />
with the space and the trailing slash.