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

ok. so a quick fix? I just strip out all the tags before markdown runs. does this sound like it will break something?

$str = preg_replace("/<.*?>(.*?)<\/.*?>/", "$1", $str);

I would much rather figure out how to make EE stop converting links.

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

Not sure how to do it from within your plugin, but is it no good doing it in the weblog preferences? “Automatically turn URLs and email addresses into links? yes/no “.

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

Ok. That seems to work well (turning it off in the Weblog’s individual preferences) so I have for everyone a revised “MarkyPants” plugin. Enjoy! And don’t forget it requires the Markdown and SmartyPants plugins to be installed also.

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

mark, I’m getting this error after setting a field formatting as markypants. markdown, smartypants, and markypants are installed.

Fatal error: Cannot redeclare identify_modifier_markdown() (previously declared in C:\dev\myproject\myadmin\plugins\pi.markdown.php:241) in C:\dev\myproject\myadmin\plugins\pi.markdown.php on line 252

did you mean that Markdown and SmartyPants should be uninstalled?

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

How are you using the formatting? As a custom field’s formatting or as tags in a template?

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

Alright, try this one out. I’ve switched around the includes to require_onces and maybe that will help. Also make sure you have the most up to date plugins from http://expressionengine.com/downloads/detailslist/. Finally I had both markdown and smarty added as formatting options under the edit field > edit formatting link. I will debug without this and see if that’s what’s causing your problem.

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

hi mark, seems to be working now cheers 😊

the only thing I hadn’t done before was also add smarty as a formatting option.

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

Ahh, I see, well I’ve tried it both with/without Markdown and Smarty as formatting options and it worked for me. Let me know if you’re still finding otherwise. Thanks for the debugging help.

       
misu's avatar
misu
30 posts
18 years ago
misu's avatar misu

deleted

       
G - B - O's avatar
G - B - O
31 posts
18 years ago
G - B - O's avatar G - B - O

From what i understand, i should add Markdown, Smartypants and Markypants, and then an extra field formatting option would appear. I tried to do so, but nothing appears, and my plugin manager-page remains white … (wich usually means there’s an error in a plugin …)

Thanks.

Update: The error appears to be in MarkyPants …

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

The only thing I can think of that would be erring in the file are these two lines:

require_once(“pi.markdown.php”); require_once(“pi.smarty_pants.php”);

Are your plugins named like above? Are they both also in the plugins folder?

       
G - B - O's avatar
G - B - O
31 posts
18 years ago
G - B - O's avatar G - B - O

Markdown is an extension, the rest are pi’s …

Is there a complete package online, to get MarkyPants going?

Thanks.

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

You’ll want to get them off the plugin list from:

http://expressionengine.com/downloads/detailsmarkdown/ http://expressionengine.com/downloads/detailssmarty-pants/

Install both of those in your plugins folder and then install markypants and you should be good to go.

       
G - B - O's avatar
G - B - O
31 posts
18 years ago
G - B - O's avatar G - B - O

Great. I’ll give it a shot later on today. If i understood correctly it appears as a field type, and would have the same functionality as standard xhtml-type PLUS the markdown-thingy?

Thanks!

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

It actually only has the markdown functionality. Which shouldn’t be a problem because markdown replicates all the necessary XHTML formatting anyway.

       
1 2 3 4

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.