Commit a05ae766 authored by Pierre Dittgen's avatar Pierre Dittgen

Use markdown in headers

parent 657b8d41
...@@ -11,6 +11,7 @@ import jinja2 ...@@ -11,6 +11,7 @@ import jinja2
import pkg_resources import pkg_resources
import requests import requests
import tableschema import tableschema
from commonmark import commonmark
import opendataschema import opendataschema
...@@ -97,6 +98,15 @@ def urlencode(context, value): ...@@ -97,6 +98,15 @@ def urlencode(context, value):
return quote_plus(value) return quote_plus(value)
@jinja2.contextfilter
@blueprint.app_template_filter()
def commonmark2html(context, value):
return commonmark(value)
app.register_blueprint(blueprint)
@app.context_processor @app.context_processor
def inject_version(): def inject_version():
global VERSION global VERSION
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
<thead class="thead-light"> <thead class="thead-light">
<th scope="col">1</th> <th scope="col">1</th>
{% for h in source_data.header %} {% for h in source_data.header %}
<th scope="col" data-toggle="popover" title="{{ report.table.headers_title[loop.index - 1] }}" data-content="{{ report.table.headers_description[loop.index - 1]}}">{{ <th scope="col" data-toggle="popover" title="{{ report.table.headers_title[loop.index - 1]}}" data-content="{{ report.table.headers_description[loop.index - 1] | commonmark2html | escape}}">{{
h }}</th> h }}</th>
{% endfor %} {% endfor %}
</thead> </thead>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment