austgl / python-markdown2

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

conversion problem with this embedded raw HTML (2) #44

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
{{{
#22 builds of Komodo

<img style="width: 150px; height: 134px; margin: 0 5px 5px 0; float: left;" 
src="22-builds-of-komodo.png" alt="Komodo heart LA Zoo">
</img>

Last Thursday the LA Zoo & Botanical Gardens
[tweeted](http://twitter.com/LAZoo/status/22106438732) that they'd
successfully hatched 22 Komodo dragons ([more
info](http://www.lazoo.org/about/press/0810/0825komodos.html)). That's
awesome! Congratulations to the Zoo staff on their efforts. In celebration,
**we'll donate 20% of all [Komodo
IDE](http://www.activestate.com/komodo-ide) sales for Tuesday, Aug 31st
to the LA Zoo.**
}}}

The img tag gets all screwed up. Tried both with and without the close `</img>`

{{{
<h3>22 builds of Komodo</h3>

<p><img style="width: 150px; height: 134px; margin: 0 5px 5px 0; float: 
left;&#8221; src="22-builds-of-komodo.png&#8221; alt="Komodo heart LA Zoo">
</img></p>

<p>Last Thursday the LA Zoo &amp; Botanical Gardens
<a href="http://twitter.com/LAZoo/status/22106438732">tweeted</a> that 
they&#8217;d
successfully hatched 22 Komodo dragons (<a 
href="http://www.lazoo.org/about/press/0810/0825komodos.html">more
info</a>). That&#8217;s
awesome! Congratulations to the Zoo staff on their efforts. In celebration,
<strong>we&#8217;ll donate 20% of all <a 
href="http://www.activestate.com/komodo-ide">Komodo
IDE</a> sales for Tuesday, Aug 31st
to the LA Zoo.</strong></p>
}}}
}}}

Original issue reported on code.google.com by tre...@gmail.com on 30 Aug 2010 at 6:41

GoogleCodeExporter commented 9 years ago
Looks like smarty-pants extra might be causing problems here. Need to have it 
guard against working in HTML blocks.

Original comment by tre...@gmail.com on 30 Aug 2010 at 6:42

GoogleCodeExporter commented 9 years ago
I *think* this issue might be solved if you change _closing_double_quote_re to 
have an additional negative lookahead assertion (?!.*>).

_closing_double_quote_re = re.compile(r'(?<=\S)"(?=(\s|,|;|\.|\?|!|$))(?!.*>)')

I'm guessing this isn't really the ideal way of fixing this problem.  It would 
probably be better to track if you are inside of an anchor or image, and if so, 
don't run smarty pants at all.

Original comment by tg...@protozoic.com on 6 Mar 2011 at 10:05