austgl / python-markdown2

Automatically exported from code.google.com/p/python-markdown2
Other
0 stars 0 forks source link

smarty-pants and quotes in between backticks #48

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
smarty-pants shouldn't modify quotations marks or anything in between backticks.

The step to reproduce:

1. echo "\`'abc'\`" > test.mkd
2. python markdown2.py -x smarty-pants test.mkd

The content of test.mkd is

    `'abc'`

The correct output should be

    <p><code>'abc'</code></p>

But I got

    <p><code>&#8217;abc&#8217;</code></p>

I am using r263.

Original issue reported on code.google.com by livibet...@gmail.com on 5 Nov 2010 at 5:03

GoogleCodeExporter commented 9 years ago
I've managed to stop smarty-pants from acting on apostrophes and quotation 
marks, but getting it to ignore hyphens and periods has produced some curious 
bugs.  I have a more detailed description in this commit message:

https://github.com/NikhilChelliah/python-markdown2/commit/545d8f2139e65845842435
ce5f0e1cef77950c01

Question for Trent: why are "-", ".", and other characters included in 
`g_escape_table` but not used in the `_encode_code` function?  Are hyphens and 
periods supposed to be special characters in code spans, for whatever reason?

Original comment by nikhil.chelliah on 27 Mar 2011 at 5:58