Add in anchor link, and update link in notification history.

This commit is contained in:
Nicholas Staples
2016-03-17 10:59:47 +00:00
parent a13ecc5cb5
commit 0411238dd9
3 changed files with 8 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ import os
import re
import dateutil
import urllib
from flask import (Flask, session, Markup, escape, render_template, make_response, current_app)
from flask._compat import string_types
from flask_login import LoginManager
@@ -75,6 +76,7 @@ def create_app(config_name, config_overrides=None):
application.add_template_filter(format_time)
application.add_template_filter(syntax_highlight_json)
application.add_template_filter(valid_phone_number)
application.add_template_filter(linkable_name)
application.after_request(useful_headers_after_request)
register_errorhandlers(application)
@@ -139,6 +141,10 @@ def nl2br(value):
return Markup(result)
def linkable_name(value):
return urllib.parse.quote_plus(value)
def syntax_highlight_json(code):
return Markup(highlight(code, JavascriptLexer(), HtmlFormatter(noclasses=True)))