Changeset 173

Show
Ignore:
Timestamp:
03/30/06 05:19:31 (3 years ago)
Author:
abaxter
Message:

new renderer to produce anchors (a name="foo") from arbitrary input strings.
used in the news and RSS feeds.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/pyramid/page.py

    r172 r173  
    4444        '''Turns the data into a string''' 
    4545        return str(data) 
     46 
     47    def render_anchorify(self, ctx, data): 
     48        '''Turn the data into something suitable for an anchor''' 
     49        import string 
     50        nulltrans = string.maketrans('', '') 
     51        data = str(data).translate(nulltrans, """ ,'"<>&+:.""") 
     52        return data 
    4653 
    4754    def render_tree(self,ctx,data):