summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-11-11 19:40:50 +0100
committerGeorg Brandl <georg@python.org>2014-11-11 19:40:50 +0100
commit543b3cb13bbafa81805b039fe955e60794b4ae5e (patch)
tree2a32ea26a435368a351f639725eadf62c6df2c6d /pygments
parent6449543ebb434d613ee6d3a57ea9cc527b7aeeef (diff)
downloadpygments-543b3cb13bbafa81805b039fe955e60794b4ae5e.tar.gz
More coverage of newer HTML formatter options.
Diffstat (limited to 'pygments')
-rw-r--r--pygments/formatters/html.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/pygments/formatters/html.py b/pygments/formatters/html.py
index 2c6de4ca..f15edc7e 100644
--- a/pygments/formatters/html.py
+++ b/pygments/formatters/html.py
@@ -36,21 +36,11 @@ _escape_html_table = {
ord("'"): u'&#39;',
}
+
def escape_html(text, table=_escape_html_table):
"""Escape &, <, > as well as single and double quotes for HTML."""
return text.translate(table)
-def get_random_id():
- """Return a random id for javascript fields."""
- from random import random
- from time import time
- try:
- from hashlib import sha1 as sha
- except ImportError:
- import sha
- sha = sha.new
- return sha('%s|%s' % (random(), time())).hexdigest()
-
def _get_ttype_class(ttype):
fname = STANDARD_TYPES.get(ttype)