1 of 2
1
PHP Markdown Extra Plugin
Posted: 14 May 2007 03:00 PM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  53
Joined  12-27-2005

I consider the Markdown plugin to be a necessary addition to each and every EE site that I develop, and so I’ve taken it upon myself to update the existing plugin to use PHP Markdown Extra by Michel Fortin.  This should be used as a replacement for the current plugin, rather than an additional one.

If you’re unfamiliar with the benefits that PHP Markdown Extra provides, please check out http://www.michelf.com/projects/php-markdown/extra/.  To sum it up, here are the new features:

* Use Markdown inside HTML blocks
* Add id attribute to headers
* Tables
* Definition lists
* Footnotes
* Abbreviations

There shouldn’t be any issues with the plugin, since all I’ve done is overwritten the old Markdown code with the new version, and changed some of the text in the plugin information section.  Enjoy!

Download Now!

Update: 10/10/08 - Plugin now uses Markdown Extra 1.2.2. I also stripped out some extra code that was only used for WordPress compatibility. And, since the forum will not let me upload the file due to the “invalid content for its MIME type” error, you will need to download the file from the URL above.

 Signature 

http://kuzemchak.net/

Profile
 
 
Posted: 23 May 2007 11:45 PM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  17
Joined  02-05-2007

Will this add “markdown” as a formatting option in the custom field setup?

PS: w00t HU Bisons!

Profile
 
 
Posted: 24 May 2007 07:39 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  298
Joined  01-20-2006

Omigosh, I was *JUST* thinking about this last night.

Now, we’ll go see if it works with markypants too.

 Signature 

AJ Penninga
Pretty Squares, LLC - http://www.prettysquares.com

Profile
 
 
Posted: 24 May 2007 07:41 AM   [ Ignore ]   [ # 3 ]  
Grad Student
Avatar
Rank
Total Posts:  53
Joined  12-27-2005
jrtowell - 23 May 2007 11:45 PM

Will this add “markdown” as a formatting option in the custom field setup?

PS: w00t HU Bisons!

It will do everything that the original Markdown plugin did.  So in short, yes it will grin

 Signature 

http://kuzemchak.net/

Profile
 
 
Posted: 12 November 2007 11:25 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
RankRankRank
Total Posts:  968
Joined  11-01-2002

I put the tag around my {body} in my main page templat and then put some list entries and they were not converted.

What am I doing wrong?

Profile
 
 
Posted: 12 November 2007 01:04 PM   [ Ignore ]   [ # 5 ]  
Grad Student
Avatar
Rank
Total Posts:  53
Joined  12-27-2005
Erin Dalzell - 12 November 2007 11:25 AM

I put the tag around my {body} in my main page templat and then put some list entries and they were not converted.

What am I doing wrong?

Can you paste your code here?

 Signature 

http://kuzemchak.net/

Profile
 
 
Posted: 12 November 2007 05:51 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
RankRankRank
Total Posts:  968
Joined  11-01-2002

<div class="post-summary">
{summary}
{link_summary}
{exp
:markdown}
{body}
{
/exp:markdown}
{extended}
</div>

Profile
 
 
Posted: 12 November 2007 07:44 PM   [ Ignore ]   [ # 7 ]  
Grad Student
Avatar
Rank
Total Posts:  53
Joined  12-27-2005

Rather than using the tags in the template, you may want to try setting markdown as the default formatting option for the {body} field.  See here:

http://expressionengine.com/docs/cp/admin/weblog_administration/custom_fields_edit.html

You’ll need to click the Edit List button and make sure that Markdown is turned on.  Then confirm the changes and before you save the custom field, check the box next to “Update all existing section entries with your new formatting choice?”

You should be able to use Markdown formatting without using the {exp:markdown} tags in the template.

 Signature 

http://kuzemchak.net/

Profile
 
 
Posted: 12 November 2007 09:46 PM   [ Ignore ]   [ # 8 ]  
Research Assistant
RankRankRank
Total Posts:  968
Joined  11-01-2002

Awesome! That worked great!

Profile
 
 
Posted: 20 December 2007 01:17 PM   [ Ignore ]   [ # 9 ]  
Summer Student
Avatar
Total Posts:  14
Joined  12-16-2007

I love the fact that EE let’s you choose your desired formatting. It’s such a flexible feature.

However, I still can’t manage to type in links, the official way (http://daringfireball.net/projects/markdown/syntax#link )


eg. [Google Homepage] (http://www.google.com)

should render as:

<a href=“http://www.google.com>Google Homepage</a>

Instead, EE+MDplugin renders it as:

[Google Homepage] (<a href=“http://www.google.com”>[Google Homepage] (http://www.google.com)</a>)

Profile
 
 
Posted: 20 December 2007 03:32 PM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  749
Joined  07-18-2006

it looks like you have EE set to parse your fields for links. It should be fine if you turn that off (Weblog Admin->Weblog Management->Edit Prefs->Weblog Posting Prefs).

Profile
 
 
Posted: 20 December 2007 03:45 PM   [ Ignore ]   [ # 11 ]  
Summer Student
Avatar
Total Posts:  14
Joined  12-16-2007

Hi Brian, thanks for your answer.

I did check and tried that setting. However, if I turn it off, EE doesn’t render anything at all (except my non-link related Markdown tags, these are rendered OK). The markdown-link just appears as plain text:

[Google Homepage] (http://www.google.com)

I have tried putting the {exp:markdown}{/exp:markdown} tags around my body, but that didn’t change a thing either.

Profile
 
 
Posted: 20 December 2007 04:00 PM   [ Ignore ]   [ # 12 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  749
Joined  07-18-2006

In the field formatting itself (custom field settings) - is that set to “none”?

Profile
 
 
Posted: 20 December 2007 04:06 PM   [ Ignore ]   [ # 13 ]  
Summer Student
Avatar
Total Posts:  14
Joined  12-16-2007

No, the “formatting” dropdown underneath my body entry field is set to “Markdown”.

Profile
 
 
Posted: 20 December 2007 04:10 PM   [ Ignore ]   [ # 14 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  749
Joined  07-18-2006
Garrulus - 20 December 2007 04:06 PM
No, the “formatting” dropdown underneath my body entry field is set to “Markdown”.

Ahhh I figured it out. There shouldn’t be a space between your [] and your (). Remove that and it works smile

Profile
 
 
Posted: 20 December 2007 04:12 PM   [ Ignore ]   [ # 15 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  749
Joined  07-18-2006

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](http://www.google.com “Google”)

This doesn’t:

[Google Homepage](http://www.google.com)

Maybe it’s his way of furthering web standards wink

Profile
 
 
Posted: 20 December 2007 04:13 PM   [ Ignore ]   [ # 16 ]  
Summer Student
Avatar
Total Posts:  14
Joined  12-16-2007

Ooops red face

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

Profile
 
 
Posted: 20 December 2007 04:16 PM   [ Ignore ]   [ # 17 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  749
Joined  07-18-2006

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.

Profile
 
 
Posted: 21 March 2008 12:29 AM   [ Ignore ]   [ # 18 ]  
Summer Student
Total Posts:  5
Joined  05-15-2004

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?

Profile
 
 
   
1 of 2
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 62658 Total Logged-in Users: 34
Total Topics: 77195 Total Anonymous Users: 23
Total Replies: 416709 Total Guests: 244
Total Posts: 493904    
Members ( View Memberlist )