##// END OF EJS Templates
Add strip_url_static_file_prefix to filters
Peter Davis -
Show More
@@ -19,6 +19,8 b' import re'
19 # Globals and constants
19 # Globals and constants
20 #-----------------------------------------------------------------------------
20 #-----------------------------------------------------------------------------
21
21
22 MARKDOWN_IMAGE_RE = re.compile(r'!\[(?P<caption>.*?)\]\(/?files/(?P<location>.*?)\)')
23
22 LATEX_RE_SUBS = (
24 LATEX_RE_SUBS = (
23 (re.compile(r'\.\.\.+'), r'\\ldots'),
25 (re.compile(r'\.\.\.+'), r'\\ldots'),
24 )
26 )
@@ -44,7 +46,8 b' LATEX_SUBS = {'
44 # Functions
46 # Functions
45 #-----------------------------------------------------------------------------
47 #-----------------------------------------------------------------------------
46
48
47 __all__ = ['escape_latex']
49 __all__ = ['escape_latex',
50 'strip_url_static_file_prefix']
48
51
49 def escape_latex(text):
52 def escape_latex(text):
50 """
53 """
@@ -61,3 +64,9 b' def escape_latex(text):'
61
64
62 return text
65 return text
63
66
67
68 def strip_url_static_file_prefix(text):
69 text = MARKDOWN_IMAGE_RE.sub(r'![\1](\2)', text)
70 return text
71
72
General Comments 0
You need to be logged in to leave comments. Login now