Changeset 1503 for trunk/pylucid/PyLucid/system/tinyTextile.py
- Timestamp:
- 03/25/08 09:24:47 (8 months ago)
- Files:
-
- 1 modified
-
trunk/pylucid/PyLucid/system/tinyTextile.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pylucid/PyLucid/system/tinyTextile.py
r1500 r1503 28 28 __version__ = "$Rev$" 29 29 30 import sys, re , string30 import sys, re 31 31 32 32 from PyLucid.tools.utils import escape … … 34 34 35 35 36 HEADLINE = (37 '<h%(no)s id="%(anchor)s">'38 '<a title="Link to this section" href="%(link)s#%(anchor)s" class="anchor">'39 '%(txt)s</a>'40 '</h%(no)s>\n'41 )42 43 44 36 class TinyTextileParser: 45 def __init__(self, out_obj, permalink,context):37 def __init__(self, out_obj, context): 46 38 self.out = out_obj 47 self.permalink = permalink48 39 self.context = context 49 40 self.page_msg = context["page_msg"] … … 53 44 [ # <h1>-Headlines 54 45 r"\Ah(\d)\. (.+)(?usm)", 55 self.headline46 r"<h\1>\2</h\1>" 56 47 ], 57 48 ]) … … 165 156 def escaping(self, matchobj): 166 157 return escape(matchobj.group(1)) 167 168 def headline(self, matchobj):169 """170 Insert a html headline with a anchor.171 """172 text = matchobj.group(2)173 anchor = "".join(174 [char for char in text if char in string.ascii_letters]175 )176 result = HEADLINE % {177 "no": matchobj.group(1),178 "txt": text,179 "link": self.permalink,180 "anchor": anchor,181 }182 return result183 158 184 159 def shortcutLink(self, matchobj):
