[kramdown-users] smartypants-only switch

Matt Neuburg matt at tidbits.com
Fri Aug 6 13:48:20 EDT 2010

This may have already been answered and I may have dropped the ball; if so,
I apologize.

In Frontier, and in RubyFrontier, my Web site framework has applied Markdown
and SmartyPants in two separate stages. The reason is that SmartyPants is
smart about making quotes and apostrophes curly throughout the *whole* page
- it stays out of tags and the insides of <code> and <tt>, but it dives into
all other displayed content and makes curly quotes.

Now, kramdown lacks this; it is all or nothing. If you say
<...markdown="1">, everything inside that tag gets the ENTIRE markdown
treatment, plus smartypants treatment. But for something like the <title>
tag, this is a bit heavy-handed. I'd like to be able to say <title
smartypants="1">, or maybe <title markdown="smarty">, so that kramdown will
apply its *only* curly-quoting smartification inside the <title> tag without
wasting time looking for *any* other Markdown material.

Indeed, asterisks inside the <title> tag should be legal without triggering
an incorrect additional tag inside the tag. So for example:

<title markdown="smarty">Isn't this a *test*?</title>

Would yield:

<title>Isn&#8217;t this a *test*?</title>

But perhaps there is already a better way to do this and I've forgotten what
it is...?


matt neuburg, phd = matt at tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
Take Control of Exploring & Customizing Snow Leopard
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com

More information about the kramdown-users mailing list