[kramdown-users] Proposal: new option for disabling smart quotes/typography parsers

Thomas Leitner t_leitner at gmx.at
Fri Mar 4 17:15:22 EST 2011


On 2011-03-04 10:51 -0800 Matt Neuburg wrote:
> I've been requesting this since the first day I joined this list. The
> only thing I don't get is why you take Justin seriously and you
> basically told me to stick it where the sun didn't shine. m.

I may have written the previous mail prematurely...

So, after having read through my TODO list and other mails, I think
that the current way of *not* modifying the kramdown parser is the
right way to go.

What to do if one doesn't want smart quotes or nice typographic symbols?

1. Subclass the kramdown parser and remove the parsing methods for
   smart quotes and typographic symbols.

2. Subclass the HTML converter and use the convert_smart_quote and
   convert_typographic_sym from the kramdown converter.

3. If you are using Ruby 1.9: use the option `smart_quotes` to convert
   the smart quotes to simple quote characters by setting the proper
   entity names/entity numbers.

4. Change the smart_quote/typographic_sym Entity objects to contain
   just the needed text before converting to HTML, LaTeX, ...

-- Thomas


More information about the kramdown-users mailing list