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

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

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.

       
jrtowell's avatar
jrtowell
1 posts
about 18 years ago
jrtowell's avatar jrtowell

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

PS: w00t HU Bisons!

       
AJP's avatar
AJP
311 posts
about 18 years ago
AJP's avatar AJP

Omigosh, I was JUST thinking about this last night.

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

       
Kuz's avatar
Kuz
14 posts
about 18 years ago
Kuz's avatar Kuz
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 😊

       
Erin Dalzell's avatar
Erin Dalzell
790 posts
17 years ago
Erin Dalzell's avatar Erin Dalzell

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?

       
Kuz's avatar
Kuz
14 posts
17 years ago
Kuz's avatar Kuz
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?

       
Erin Dalzell's avatar
Erin Dalzell
790 posts
17 years ago
Erin Dalzell's avatar Erin Dalzell
<div class="post-summary">
{summary}
{link_summary}
{exp:markdown}
{body}
{/exp:markdown}
{extended}
</div>
       
Kuz's avatar
Kuz
14 posts
17 years ago
Kuz's avatar Kuz

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.

       
Erin Dalzell's avatar
Erin Dalzell
790 posts
17 years ago
Erin Dalzell's avatar Erin Dalzell

Awesome! That worked great!

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

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

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

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).

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

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.

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

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

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

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

       
Brian M.'s avatar
Brian M.
529 posts
17 years ago
Brian M.'s avatar Brian M.
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 😊

       
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.