Help - Search - Members - Calendar
Full Version: Textile 2.0.4 Bug In Movable Type 4.x
Movable Type Community Forum > Other Product Discussion > Bugs and Odd Behavior
ryanjbonnell
I believe I have encountered a bug in Textile 2.0.4 bundled with Movable Type 4.01.

When an entry is formatted with Textile, two dashes (--) are no longer marked up as an em dash. Instead, the dashes are left alone and are output as "--" instead of the HTML entity for an em dash (&mdash or &#8212).

In previous relases of Textile (<2.0.2) and Movable Type (<3.34), this wasn't a problem, but is a symptom that can be reproduced using Textile 2.0.4 and Movable Type 4.01.

As far as I can tell, the problem occurs in all entry fields (I tested both MTEntryBody/mt:EntryBody and MTEntryMore/mt:EntryMore). I also have the "Replace Word Chars" option in Preferences > Blog Settings > Entry disabled ("Smart Replace" is set to "No substitution").

I'm running Apache v2.0.52 (on CentOS) with Perl v5.8.5, PHP v4.3.9, and MySQL v4.1.20.

Can anyone confirm this behavior to be a bug, and if so is there a fix available?
Su-
Textile doesn't do quote(dash, etc) conversion, SmartyPants does, which Textile makes use of if it's available.

Here's where it might get a little odd, though.
While the SmartyPants plugin did get bundled with MT4, it lives under the Markdown plugin. So first: do you still have the Markdown plugin installed?

I asked about this during the beta, but the person I was talking to wasn't sure if that would make it available to all the other formatting plugins, and I still can't get a definitive answer, but if Markdown is gone, then Smartypants is definitely gone.

I don't think there's really anything stopping you from installatin the stand-alone version of Smartypants, though.



The Replace Word Chars option is something else altogether, and cleans up the junk people tend to get when they paste in "smart quotes" from MS Word documents.
ryanjbonnell
QUOTE (Su- @ Oct 25 2007, 06:19 PM) *
So first: do you still have the Markdown plugin installed?


Yes, I'm running a stock/default installation of Movable Type 4.01 (which bundles Markdown 1.0.1 with SmartyPants 1.5.1 and Textile 2.04 among other plug-ins).

QUOTE (Su- @ Oct 25 2007, 06:19 PM) *
Textile doesn't do quote(dash, etc) conversion, SmartyPants does, which Textile makes use of if it's available.


You are correct. I've verified on a stock/default installation of Movable Type 3.35 that SmartyPants v1.5.1 is the mechanism that generates the smart typography, converting two consecutive dashes (--) to an em dash.

QUOTE (Su- @ Oct 25 2007, 06:19 PM) *
I don't think there's really anything stopping you from installatin the stand-alone version of Smartypants, though.


I actually tried this and it didnt work. I disabled the bundled version of Markdown and SmartyPants and uploaded the stand-alone SmartyPants.pl plug-in only to find no difference.

I know Movable Type 4.x moved Markdown and SmartyPants into a new "Markdown" folder within /cgi-bin/plugins/ -- which is different than Movable Type <3.35 that just had SmartPants.pl and Markdown.pl in the /cgi-bin/plugins/ folder -- but I don't know if it has any effect on Textile's ability to piggyback on the smart typography.
Su-
Bleah. Dunno what to tell you without doing some testing of my own first, then. I had figured that at worst you'd be required to put in that separate copy of Smartypants. Annoying. I followed up my initial query on this via the feedback form again today. You might give it a shot, if only to get this fixed sometime going forward.

For the time being, have you tried forcing it by adding the smarty_pants filter wherever you want the processing applied?
ryanjbonnell
QUOTE (Su- @ Oct 25 2007, 09:00 PM) *
I followed up my initial query on this via the feedback form again today. You might give it a shot, if only to get this fixed sometime going forward.


I wrote Brad Choate this afternoon and reported the bug, but it's probably worth me reporting the bug via the official Movable Type feedback form as well.

QUOTE (Su- @ Oct 25 2007, 09:00 PM) *
For the time being, have you tried forcing it by adding the smarty_pants filter wherever you want the processing applied?


I tried that too, but it didn't work either! I assume my syntax is correct: <mt:EntryBody filters="smarty_pants" />

QUOTE (Su- @ Oct 25 2007, 09:00 PM) *
Dunno what to tell you without doing some testing


I'm with you -- I will have to do more testing, but for now I'm going to write-off this odd behavior as a bug that needs fixed.
ryanjbonnell
After some experimentation and creative thinking, I was able to get Textile 2.0.4 on Movable Type 4.0.x to use SmartyPants' text formatting by hard-coding the text filter selection in the template tag:

CODE
<mt:EntryBody filters="textile_2, markdown_with_smartypants"$>


Doing this give us back the freedom to use Textile markup in an entry and have SmartyPants "educate":
  • Straight quotes ( " and ' ) into "curly" quote HTML entities
  • Backticks-style quotes (``like this'') into "curly" quote HTML entities
  • Dashes ("--" and "---") into en- and em-dash entities
  • Three consecutive dots ("...") into an ellipsis entity
While this is a work-a-round, it gives Textile in Movable Type 4.0.x the functionality it had in Movable Type <=3.35!
Ann R
I just ran into this in my setup. My MT is a managed offering from my host (who is large) and they've passed the issue to Six Apart for investigation. Hopefully we'll get a fix!

Ann

Update: So much for my optimism--Six Apart came back with Ryan's bandaid as the solution. <sigh> But thanks much for the research Ryan, at least it's working now.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.