We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

PHP Markdown Extra Plugin

Development and Programming

Brian M.'s avatar
Brian M.
529 posts
17 years ago
Brian M.'s avatar Brian M.

Oops - there’s one more thing actually - looks like you have to have a title in there as well or it doesn’t work. So this works:

Google Homepage

This doesn’t:

Google Homepage

Maybe it’s his way of furthering web standards 😉

       
Garrulus's avatar
Garrulus
10 posts
17 years ago
Garrulus's avatar Garrulus

Ooops :red:

Do I get some credit for being a total beginner with EE and Markdown?

       
Brian M.'s avatar
Brian M.
529 posts
17 years ago
Brian M.'s avatar Brian M.

Hey sure why not! I just started using Markdown myself - it’s pretty cool. You can actually leave on url and email parsing as long as you form those links properly - which is nice so you can automatically obscure your email addresses with javascript.

       
Jonathon Delacour's avatar
Jonathon Delacour
3 posts
17 years ago
Jonathon Delacour's avatar Jonathon Delacour

Many thanks for the Markdown Extra plugin. I’m in the process of switching to ExpressionEngine and Markdown support is vitally important to me.

My own tests have borne out the experience of previous posts regarding the rendering of links – the title attribute (which is optional in Markdown) is mandatory in this implementation.

I was also wondering why Markdown’s reference-style links don’t appear to be supported. I prefer reference links because they make the Markdown-formatted text much easier to read. Is there any possibility of adding support for reference links?

       
Brian M.'s avatar
Brian M.
529 posts
17 years ago
Brian M.'s avatar Brian M.

Is anyone using this with 1.6.3? I previously was able to keep ‘automatically turn urls and email addresses into links’ on while using Markdown, so someone could either use Markdown or just put in a url and both would make links, but I just installed Markdown on a 1.6.3 site and the automated links are breaking Markdown style links.

I seem to remember having this problem previously on a different site, but then somehow got it working. Can’t remember what I did though. Any help?

       
Kuz's avatar
Kuz
14 posts
16 years ago
Kuz's avatar Kuz

Just so everyone is aware, the plugin has been updated to use Markdown Extra 1.2.2, and is now free from the WordPress-specific code that comes embedded in Michel Fortin’s script.

And, since the forum is throwing issues when I try to upload the new version, you can now download it here.

       
Sean Sperte's avatar
Sean Sperte
63 posts
16 years ago
Sean Sperte's avatar Sean Sperte

Kuz, thanks for keeping the Markdown Extra plugin up to date!

I’m still having an issue with inline HTML elements getting encoded – or, more specifically, the closing tag of the element(s). I reported the issue a few years ago but wasn’t able to come to a resolution. Basically, the plugin is encoding the opening bracket (so “<” becomes “&-l-t-;”). [Dashes added to avoid entity being rendered.]

For example, a line like:

All I want for Christmas is <del>my two front teeth</del> <ins>a MacBook Pro</ins>.

Becomes:

All I want for Christmas is <del>my two front teeth&-l-t-;/del> <ins>a MacBook Pro&-l-t-;/ins>.

The strange thing is that this doesn’t seem to happen to text that’s parsed from a weblog entry – only that which is static in a template. I believe the problem is with the ExpressionEngine interpretations, not the original PHP Markdown translation – as the Dingus handles inline HTML elements as expected.

Have any insights?

       
Kuz's avatar
Kuz
14 posts
16 years ago
Kuz's avatar Kuz

Hey Sean! That’s an interesting issue, and unfortunately I don’t know much about EE’s plugin structure… I pretty much just copied the Markdown plugin that Paul wrote, but dropped in the Markdown Extra script instead. I’m also not good enough with PHP to really figure out what’s going on with it. Enough excuses though.

What I was able to find was line 1385 of pi.markdown.php:

$text = str_replace('<', '<', $text);

I found that if I commented out this line, it fixed the issue. However, I haven’t tested it enough to see what kind of negative effects this would have. If you want to play around with it, be my guest… as I’d be more than curious to see what the results were. Either way, I think we may want to try getting Michel Fortin’s opinion as to why this is happening, and what can really be done to fix it.

Thanks for bringing this up again though… I hope we can figure it all out!

       
Sean Sperte's avatar
Sean Sperte
63 posts
16 years ago
Sean Sperte's avatar Sean Sperte

Thanks Kuz, that fix does seem to be working … so far. I’ll report back here if/when I have more conclusive results.

       
Kuz's avatar
Kuz
14 posts
16 years ago
Kuz's avatar Kuz

Thanks Sean! Hopefully you won’t have any issues, but make sure to let me know, as I’ll comment that line out permanently in the code if it appears to work!

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.