Changeset 86

Show
Ignore:
Timestamp:
10/15/07 14:18:54 (15 months ago)
Author:
steadicat
Message:

Removed Smartypants from Versedown (use Typogrify instead in your templates).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • django/trunk/contrib/versedown/templatetags/versedown.py

    r84 r86  
     1import re, datetime 
    12from django import template 
    2 from designed.contrib.smartypants import smartyPants as smartypants 
    3 from designed.contrib.markdown import markdownWithFootnotes, markdown 
    4 import re, datetime 
     3from django.template.defaultfilters import striptags 
     4#from smartypants import smartyPants as smartypants 
     5from markdown import markdownWithFootnotes, markdown as basicMarkdown 
    56 
    67register = template.Library() 
     
    1819@register.filter 
    1920def versedown(text): 
    20     return smartypants(reformatFootnotes(markdownWithFootnotes(reformatNewlines(text)))) 
     21    return reformatFootnotes(markdownWithFootnotes(reformatNewlines(text))) 
     22 
     23@register.filter 
     24def markdownfn(text): 
     25    return reformatFootnotes(markdownWithFootnotes(text)) 
    2126 
    2227@register.filter 
    2328def markdown(text): 
    24     return smartypants(reformatFootnotes(markdownWithFootnotes(text))) 
     29    return basicMarkdown(text) 
    2530 
    2631@register.filter 
    2732def linedown(text): 
    2833    """Markdown for titles. Removes extra <p></p>.""" 
    29     return smartypants(markdown(text)[len(" <p>"):-len("\n </p> ")]) 
     34    return markdown(text)[len(" <p>"):-len("\n </p> ")] 
     35 
     36@register.filter 
     37def stripdown(text): 
     38    """Remove markdown formatting and return plain text. For feed titles and stuff.""" 
     39    return striptags(markdown(text)) 
    3040 
    3141@register.filter 
     
    4858    """ 
    4959    text = nn.sub(r"\n\n<p>&nbsp;</p>\n\n", text) 
    50     text = smartypants(markdown(text)) 
     60    text = markdown(text) 
    5161    text = br.sub("<br />", text) 
    5262    text = n.sub("", text)