Skip to content
Permalink
Browse files

Centering images

  • Loading branch information...
Depado committed Sep 21, 2015
1 parent bc8619b commit 3c2b28ef65434c6f66d71ab37a8a126b2631e580
Showing with 13 additions and 0 deletions.
  1. +13 −0 app/utils/markdown.py
@@ -109,6 +109,19 @@ def block_code(self, code, lang=None):
def table(self, header, body):
return "<table class='table table-bordered table-hover'>" + header + body + "</table>"

def image(self, src, title, text):
if src.startswith('javascript:'):
src = ''
text = mistune.escape(text, quote=True)
if title:
title = mistune.escape(title, quote=True)
html = '<img class="img-responsive center-block" src="%s" alt="%s" title="%s"' % (src, text, title)
else:
html = '<img class="img-responsive center-block" src="%s" alt="%s"' % (src, text)
if self.options.get('use_xhtml'):
return '%s />' % html
return '%s>' % html


class MyInlineLexer(mistune.InlineLexer, MathInlineMixin):

0 comments on commit 3c2b28e

Please sign in to comment.
You can’t perform that action at this time.