Inline styles mystery

Lou Quillio public at quillio.com
Thu Dec 9 21:18:32 EST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Michel Fortin wrote:

> "Current" as in 1.0.1b7 I presume, not 1.0?

Yes.  I found it in my own application (using Drupal) but verified
it with both the Markdown and PHP-Markdown dinguses.  Dingusususes.
   eses.

> Ok, I have absolutely not explanation for the "medium" thing or the 
> lost tailing slash and anything I tried failed to replicate your  problem.

You *can* replicate it, using only the dingusususes (okay, enough).
 John's or yours, c'est the meme chose.

Run my source through the dingus.  View the source of the dingus
output page.  The portion that renders the "HTML Preview" is not the
same as the "HTML Source".  And the mangled "HTML Preview" portion
is exactly what my Drupal installation was outputting.

> But I found a bug present since 1.0.1b2 that would lead to an incorrect 
> behaviour with this. In fact, it's a pretty big bug and I am glad to 
> find it *now*, before the official 1.0.1 release. Maybe somehow it is 
> related to your problem, I don't know.

[snip]

> By the way, something interesting to note is that PHP Markdown and PHP 
> SmartyPants both share the same `_TokenizeHTML` function. By that I 
> mean that the function is defined only once when the files parsed -- by 
> the first file included. So if there is a bug in Markdown version of 
> the function, it can "propagate" to PHP SmartyPants too. This is 
> exactly what happens on the dingus. If I use the "both" filter I get 
> this "img" tag:
> 
>     <img
>     src=&#8221;http://www.michelf.com/img/photo/michel-fortin-
> arbre.jpg&#8221;
>     alt=&#8221;&#8221; width=&#8221;155&#8221; height=&#8221;155&#8221; 
> style=&#8221;    float:right; clear:right;
>     border:none; padding:1em;&#8221; />

There it is.  They're not playing well together.

> Markdown is included first by the dingus so it's version of 
> `_TokenizeHTML` is used by both, even if the version in PHP SmartyPants 
> does not have this bug. If I select PHP SmartyPants alone, the problem 
> does not occur.

[snip]

> I don't see anything different in the HTML source and the real HTML 
> source of the page. I'm not sure what I can do about this, but it 
> should be the same.

Just view the source of the dingus page post-processing.  That's
what happens in real-world web applications that combine MD and SP
under one umbrella.  Things behave better if MD is applied after SP,
but that's nonsensical, too.

I think you've found it, Michel.  What I don't understand is why it
only occurs when these text blobs are passed around as variables,
and not when the routines are passed hard input in discrete steps.

Does _TokenizeHTML need to be private?

LQ

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBuQd4Wb6NuB4EK7oRArjhAKCQB/NUFkIqrGul92jtMhiO/nzKpACdH2ZN
MrVzmx4AkNsRvwuMc0qJyGc=
=Thpc
-----END PGP SIGNATURE-----


More information about the Markdown-discuss mailing list