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.
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?
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.
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.
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
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.