Reverted unintentional commit

- Legacy-Id: 14709
This commit is contained in:
Henrik Levkowetz 2018-02-27 17:58:25 +00:00
parent a5db4d00de
commit 9ffe1e425a
4 changed files with 10 additions and 56 deletions

View file

@ -613,6 +613,9 @@ CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
'OPTIONS': {
'MAX_ENTRIES': 10000, # 10,000
},
},
'htmlized': {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',

View file

@ -1,7 +1,6 @@
{% spaceless %}
{% autoescape off %}
{% load ietf_filters %}
{% load textfilters %}
{% if doc.get_state_slug == "rfc" %}
{% if doc.stream|slugify == "legacy" %}
@ -25,14 +24,13 @@
publisher = {% templatetag openbrace %}Internet Engineering Task Force{% templatetag closebrace %},
note = {% templatetag openbrace %}Work in Progress{% templatetag closebrace %},
url = {% templatetag openbrace %}https://datatracker.ietf.org/doc/html/{{doc.name}}-{{doc.rev}}{% templatetag closebrace %},{% endif %}
author = {% templatetag openbrace %}{% for author in doc.documentauthor_set.all %}{{ author.person.name|texescape}}{% if not forloop.last %} and {% endif %}{% endfor %}{% templatetag closebrace %},
title = {% templatetag openbrace %}{% templatetag openbrace %}{{doc.title|texescape}}{% templatetag closebrace %}{% templatetag closebrace %},
author = {% templatetag openbrace %}{% for author in doc.documentauthor_set.all %}{{ author.person.name}}{% if not forloop.last %} and {% endif %}{% endfor %}{% templatetag closebrace %},
title = {% templatetag openbrace %}{% templatetag openbrace %}{{doc.title}}{% templatetag closebrace %}{% templatetag closebrace %},
pagetotal = {{ doc.pages }},
year = {{ doc.pub_date.year }},
month = {{ doc.pub_date|date:"b" }},{% if not doc.rfc_number or doc.pub_date.day == 1 and doc.pub_date.month == 4 %}
day = {{ doc.pub_date.day }},{% endif %}
abstract = {% templatetag openbrace %}{{ doc.abstract|clean_whitespace|texescape }}{% templatetag closebrace %},
abstract = {% templatetag openbrace %}{{ doc.abstract|clean_whitespace }}{% templatetag closebrace %},
{% templatetag closebrace %}
{% endautoescape %}
{% endspaceless %}

View file

@ -1,13 +1,11 @@
from __future__ import unicode_literals
from django import template
from django.template.library import Library
from django.template.defaultfilters import stringfilter
import debug # pyflakes:ignore
from ietf.utils.text import xslugify as _xslugify
from ietf.utils.text import xslugify as _xslugify, texescape
register = template.Library()
register = Library()
@register.filter(is_safe=True)
@stringfilter
@ -28,40 +26,3 @@ def format(format, values):
tmp[f.name] = getattr(values, f.name)
values = tmp
return format.format(**values)
# ----------------------------------------------------------------------
# from django.utils.safestring import mark_safe
# class TeXEscapeNode(template.Node):
# """TeX escaping, rather than html escaping.
#
# Mostly, this tag is _not_ the right thing to use in a template that produces TeX
# markup, as it will escape all the markup characters, which is not what you want.
# Use the '|texescape' filter instead on text fragments where escaping is needed
# """
# def __init__(self, nodelist):
# self.nodelist = nodelist
#
# def render(self, context):
# saved_autoescape = context.autoescape
# context.autoescape = False
# text = self.nodelist.render(context)
# text = texescape(text)
# context.autoescape = saved_autoescape
# return mark_safe(text)
#
# @register.tag('texescape')
# def do_texescape(parser, token):
# args = token.contents.split()
# if len(args) != 1:
# raise TemplateSyntaxError("'texescape' tag takes no arguments.")
# nodelist = parser.parse(('endtexescape',))
# parser.delete_first_token()
# return TeXEscapeNode(nodelist)
@register.filter('texescape')
@stringfilter
def texescape_filter(value):
"A TeX escape filter"
return texescape(value)

View file

@ -11,8 +11,6 @@ from django.utils.safestring import mark_safe
import debug # pyflakes:ignore
from texescape import init as texescape_init, tex_escape_map
@keep_lazy(six.text_type)
def xslugify(value):
"""
@ -176,9 +174,3 @@ def dict_to_text(d):
for k, v in d.items():
t += "%s: %s\n" % (k, v)
return t
def texescape(s):
if not tex_escape_map:
texescape_init()
t = s.translate(tex_escape_map)
return t