Markdown-PHP and the single opening quote character

Brian Forte bforte at adelaide.on.net
Fri Jul 7 00:30:27 EDT 2006


Gentlefolk,

______________________________________________________
the setup

CMS: WordPress 1.5.2
Markdown version: 1.0.1c
Markdown implementation: PHP version by Michel Fortin
other active WP plugins: none

URL: <http://betweenborders.com/reflections/field-notes-from-inside-a-car/>

______________________________________________________
the pre-processed text:

When my children were younger they would pass the time on long car
journeys (ie anything more than a five minute trip) playing
'spot-a-bug.'

It's a pretty simple game. You look for Volkswagens and, as soon as
you see one, shout out 'spot-a-bug.' The first to do so wins the
round. Keeping track of how many rounds you win was officially part
of the rules but individual victories were much more important than
extended counts.

Today both my kids are in high school and the game has changed. As we
head in to school each morning, or around to their various
after-school activities, I'm regularly assailed with cries of 'MLC.'

______________________________________________________
the post-processed html:

<p>When my children were younger they would pass the time on long car
journeys (ie anything more than a five minute trip) playing
&#8217;spot-a-bug.&#8217;</p>

<p>It&#8217;s a pretty simple game. You look for Volkswagens and, as
soon as you see one, shout out &#8217;spot-a-bug.&#8217; The first to
do so wins the round. Keeping track of how many rounds you win was
officially part of the rules but individual victories were much more
important than extended counts.</p>

<p>Today both my kids are in high school and the game has changed. As
we head in to school each morning, or around to their various
after-school activities, I&#8217;m regularly assailed with cries of
&#8216;MLC.&#8217;</p>


Note the inconsistent transformation of opening quote marks. The string

'spot-a-bug.'

in paragraph 2 is transformed as follows

&#8217;spot-a-bug.&#8217;

While the string

'MLC.'

in paragraph 3 is transformed as follows

&#8216;MLC.&#8217;


Of the two I, hardly surprisingly, prefer the latter: &#8216; is the
numerical entity for a typographically proper opening quote mark.

FWIW, further along in the article referenced above the string
"[space]'" is twice transformed into "[space]&#8216;". And I can, of
course, fix the problem by adding the appropriate entity to the
ur-text.

But I'm curious to know if there's something I can do to make
Markdown PHP always transform

[space]'

into

[space]&#8216;

TIA

Regards,

Brian Forte.
--
Brian Forte, <mailto:bforte at betweenborders.com>
Writer, editor, scripter, dangerous mind.


More information about the Markdown-Discuss mailing list