def typogrify(data): if typo is None: req_missing(['typogrify'], 'use the typogrify filter') data = typo.amp(data) data = typo.widont(data) data = typo.smartypants(data) # Disabled because of typogrify bug where it breaks <title> # data = typo.caps(data) data = typo.initial_quotes(data) return data
def typogrify(data): global typogrify_filter if typo is None: raise Exception("To use the typogrify filter, you need to install typogrify.") data = typo.amp(data) data = typo.widont(data) data = typo.smartypants(data) # Disabled because of typogrify bug where it breaks <title> #data = typo.caps(data) data = typo.initial_quotes(data) return data
def typogrify_sans_widont(data): # typogrify with widont disabled because it caused broken headline # wrapping, see issue #1465 if typo is None: req_missing(['typogrify'], 'use the typogrify_sans_widont filter') data = typo.amp(data) data = typo.smartypants(data) # Disabled because of typogrify bug where it breaks <title> # data = typo.caps(data) data = typo.initial_quotes(data) return data
def typogrify(data): """Prettify text with typogrify.""" if typo is None: req_missing(["typogrify"], "use the typogrify filter") data = typo.amp(data) data = typo.widont(data) data = typo.smartypants(data) # Disabled because of typogrify bug where it breaks <title> # data = typo.caps(data) data = typo.initial_quotes(data) return data
def applyfilters(text): """Applies the following filters: smartypants, caps, amp, initial_quotes >>> typogrify('<h2>"Jayhawks" & KU fans act extremely obnoxiously</h2>') '<h2><span class="dquo">“</span>Jayhawks” <span class="amp">&</span> <span class="caps">KU</span> fans act extremely obnoxiously</h2>' """ text = amp(text) text = smartypants(text) text = caps(text) text = initial_quotes(text) return text
def typogrify_sans_widont(data): """Prettify text with typogrify, skipping the widont filter.""" # typogrify with widont disabled because it caused broken headline # wrapping, see issue #1465 if typo is None: req_missing(["typogrify"], "use the typogrify_sans_widont filter") data = typo.amp(data) data = typo.smartypants(data) # Disabled because of typogrify bug where it breaks <title> # data = typo.caps(data) data = typo.initial_quotes(data) return data
def typogrify(data): """Prettify text with typogrify.""" if typo is None: req_missing(['typogrify'], 'use the typogrify filter', optional=True) return data data = _normalize_html(data) data = typo.amp(data) data = typo.widont(data) data = typo.smartypants(data) # Disabled because of typogrify bug where it breaks <title> # data = typo.caps(data) data = typo.initial_quotes(data) return data
def typogrify_sans_widont(data): """Prettify text with typogrify, skipping the widont filter.""" # typogrify with widont disabled because it caused broken headline # wrapping, see issue #1465 if typo is None: req_missing(['typogrify'], 'use the typogrify_sans_widont filter') data = _normalize_html(data) data = typo.amp(data) data = typo.smartypants(data) # Disabled because of typogrify bug where it breaks <title> # data = typo.caps(data) data = typo.initial_quotes(data) return data
def typogrify_no_widont(value): value = Typogrify.amp(value) value = Typogrify.smartypants(value) value = Typogrify.caps(value) value = Typogrify.initial_quotes(value) return value