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

Markdown and Smarty Pants

Development and Programming

Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

Here’s a simple plugin to allow both Markdown formatting and SmartyPants rendering in one plugin. You’ll have to install this plugin and the two Gruber files here:

http://expressionengine.com/downloads/details/markdown/ http://expressionengine.com/downloads/details/smartypants/

Enjoy.

       
Mr. Wilson's avatar
Mr. Wilson
131 posts
18 years ago
Mr. Wilson's avatar Mr. Wilson

I’m not sure I understand how this is different from EE’s built-in ability to use plugins for default text formatting. Can you clarify?

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

Wow, all this time adding/removing and editing fields and I never saw/bothered to look under that link. Huh, pretty cool. Thanks for pointing this out. Do you know if anyone has written a Markdown or Smarty format?

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
18 years ago
Lisa Wess's avatar Lisa Wess

If you install the markdown/smarty plugins (plugins.pmachine.com) - they should show up in that list. I am pretty sure these plugins exist. =)

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

huh. Thanks a lot!

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

Ok. so i got them installed. Now is there any way to use both Markdown and Smarty at the same time? Being a drop down list you can only choose one format.

       
Mr. Wilson's avatar
Mr. Wilson
131 posts
18 years ago
Mr. Wilson's avatar Mr. Wilson

Lisa probably knows for sure, but I think you’d have to merge the plugins into the mutant Smartdown to achieve that.

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
18 years ago
Lisa Wess's avatar Lisa Wess

Not that I’m aware of, short of merging them into one plugin.

       
Derek Jones's avatar
Derek Jones
7,561 posts
18 years ago
Derek Jones's avatar Derek Jones
Lisa probably knows for sure, but I think you’d have to merge the plugins into the mutant Smartdown to achieve that.

If I were doing it, it would be Markypants.

       
Mr. Wilson's avatar
Mr. Wilson
131 posts
18 years ago
Mr. Wilson's avatar Mr. Wilson
If I were doing it, it would be Markypants.

:ahhh:

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

hehehe. Markypants. hehe.

So, what do you think is a better solution. A combined “Markypants” or an extension that alters the XHTML formatting to include both?

       
Derek Jones's avatar
Derek Jones
7,561 posts
18 years ago
Derek Jones's avatar Derek Jones
hehehe. Markypants. hehe. So, what do you think is a better solution. A combined “Markypants” or an extension that alters the XHTML formatting to include both?

I’d prefer a plugin myself, as you don’t necessarily want everything that’s run through XHTML typography to be handled by these formatting plugins. What if another plugin, extension, or module utilizes the core typography parsing and expects certain input and output? And keep in mind that in either scenario, you can call plugins from within a plugin, so you won’t need to duplicate any code, but merely require that the other plugins are installed. Should either of those plugins change, that will also mean that you won’t have to duplicate those changes in your own solution.

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

Ahh, well. Off to work I go then.

       
Jamie Pittock's avatar
Jamie Pittock
108 posts
18 years ago
Jamie Pittock's avatar Jamie Pittock

what would be good is an extension that adds markdown to the “Default Text Formatting for This Field” dropdown when adding custom fields.

I always use markdown for large textareas and it’s a little frustrating that you can’t add markdown (or any others) to the list unless you’re editing the field.

I’ve always had to create the custom field with xhtml as the formatting, save it, go back in to edit it, click the link to edit the list, choose markdown, and then remember to click the checkbox at the bottom, and save.

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

I’ve tried combining the two however when I choose MarkyPants from the formatting drop down and try to publish a link it seems to get converted twice (once by Markdown and once by EE’s internal formatting). Because of that I get links like this:

<a href="http://a" target="_blank" rel="noopener">http://example.net/</a">This link</a>

It seems that MarkyPants is creating the link and then EE is converting the link again inside of the Markdown link. Is there any way to turn off EE’s ability to convert links from within my plugin?

Thanks

       
1 2 3 Last

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.