Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
handle existing style tag
  • Loading branch information
flying-sheep committed Apr 3, 2021
commit fa8bceb4339c2aed0ea4608601a8c96cfa98fe9c
8 changes: 5 additions & 3 deletions lib/github/commands/rest2html
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,11 @@ class GitHubHTMLTranslator(HTMLTranslator):
align = node.parent.get('align')

if align:
self.body[-1] = self.body[-1].replace(
' />', ' style="float: %s" />' % align
)
if ' style="' in self.body[-1]:
old, new = ' style="', ' style="float: %s; ' % align
else:
old, new = ' />', ' style="float: %s" />' % align
self.body[-1] = self.body[-1].replace(old, new)

def depart_image(self, node):
uri = node['uri']
Expand Down