diff options
| -rwxr-xr-x | parser.py | 6 | ||||
| -rw-r--r-- | templates/thoughts.html | 14 | 
2 files changed, 12 insertions, 8 deletions
| @@ -33,9 +33,13 @@ class HighlighterRenderer(misaka.SaferHtmlRenderer):          out = '\n<blockquote>'          for line in houdini.escape_html(content.strip()).split("\n"):              out += '\n<span class="quote">{}</span><br>'.format(line) -        print(out)          return out + '\n</blockquote>' +    def image(self, link, title, alt): +        return "<a href='%s' target='_blank'><img alt='%s' src='%s'></a>" % ( +            urlparse(link)._replace(query='').geturl(), alt, link +        ) +  def get_thought_from_id(db, id_):      category_name, title, dt, markdown = db.get_thought(id_)      return category_name, title, dt, parse_text(markdown) diff --git a/templates/thoughts.html b/templates/thoughts.html index 0d768e4..bdbe854 100644 --- a/templates/thoughts.html +++ b/templates/thoughts.html @@ -1,12 +1,12 @@  {% extends "template.html" %}  {% block content %}      {% for category_name, thoughts in tree.items() %} -    <h2 id={{category_name.replace(' ', '_')}}>{{category_name}}</h2> -    <dl> -        {% for id_, title, dt in thoughts %} -        <dt><a href={{'/thought?id=%i' % id_}}>{{title}}</a></dt> -        <dd>{{dt}}</dd> -        {% endfor %} -    </dl> +        <h3 id="{{category_name.replace(' ', '_')}}">{{category_name}}</h3> +        <dl> +            {% for id_, title, dt in thoughts %} +                <dt><a href="{{'/thought?id=%i' % id_}}">{{title}}</a></dt> +                <dd>{{dt}}</dd> +            {% endfor %} +        </dl>      {% endfor %}  {% endblock %}
\ No newline at end of file | 
