mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Add in anchor link, and update link in notification history.
This commit is contained in:
@@ -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)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user