EE’s Textile implementation broken? Doesn’t match “official” Textile output
Posted: 05 October 2008 07:04 AM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  38
Joined  04-27-2007

ExpressionEngine’s Textile plugin seems to be a bit borked, at least when comparing its output to not only the official implementation but a few others (e.g., TextMate).

Here’s an example: I was writing a comment on my blog, and typed in the following Textile snippet:

bq. Hopefully you’ll be there.

Hey, "Todd":http://unstoppablerobotninja.com/entry/an-event-apart-2009/#comment-606—at the moment, I’m actually speaking at Seattle and San Francisco. So basically, I’m currently on the lineup for the _not_-Boston AEA(An Event Apart)s. But hey, do keep an eye on the "MS&S(Markup and Style Society)":http://markupandstyle.org/, and hopefully we can catch up soon.

Here’s what the official Textile page returns:

<blockquote>
    <
p>Hopefully you’ll be there.</p>
</
blockquote>

<
p>Hey, <a href="http://unstoppablerobotninja.com/entry/an-event-apart-2009/#comment-606—at">Todd</a> the moment, I’m actually speaking at Seattle and San Francisco. So basically, I’m currently on the lineup for the <em>not</em>-Boston <acronym title="An Event Apart">AEA</acronym>s. But hey, do keep an eye on the <a href="http://markupandstyle.org/" title="Markup and Style Society">MS&S</a>, and hopefully we can catch up soon.</p>

This is what ExpressionEngine returns, however:

<p>
bq. Hopefully you’ll be there.
</
p>

<
p>
Hey, &#8220;Todd&#8221;:http://unstoppablerobotninja.com/entry/an-event-apart-2009/#comment-606—at the moment, I’m actually speaking at Seattle and San Francisco. So basically, I’m currently on the lineup for the <em>not</em>-Boston <acronym title="An Event Apart">AEA</acronym>s. But hey, do keep an eye on the <a href="http://markupandstyle.org/" title="Markup and Style Society">MS&S</a>, and hopefully we can catch up soon.
</p>

A few things seem to be going on here:

# Block-level elements such as blockquote, h1, h2, etc. are ignored by the Textile plugin if they appear on the first line of the textarea.
# Links aren’t processed if any non-URL characters are appended to the <code>“link”:URL</code> string.

There is, I believe, some wacky processing with lists (both ordered and unordered) as well, but I don’t have a test case handy. I’ve just experienced a lot of output inconsistencies with the plugin, and thought I’d raise the issue.

If anyone has any insight, it’d be much appreciated.

 Signature 

Ethan is a Senior Designer at Airbag Industries, LLC., and wants to be an unstoppable robot ninja when he grows up.

Beep.

Profile
 
 
Posted: 05 October 2008 12:47 PM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1726
Joined  03-26-2006

What version of the Textile plugin are you using? The current version is 1.1.1 (2.0.0 r2779)

Your note about the lists makes me wonder if you aren’t using a previously ‘broken’ version of the plugin - about which there are a few threads written here.

 Signature 

ryan masuga
—————
Masuga Design | Member, EE Pro Network
My EE Add-Ons | {devot:ee}
Twitter: masuga | masugadesign | devot_ee

Profile
 
 
Posted: 06 October 2008 08:03 AM   [ Ignore ]   [ # 2 ]  
Grad Student
Avatar
Rank
Total Posts:  38
Joined  04-27-2007

I actually upgraded to 1.1.1 (2.0.0 r2779) before posting, but the output before and after was the same.

 Signature 

Ethan is a Senior Designer at Airbag Industries, LLC., and wants to be an unstoppable robot ninja when he grows up.

Beep.

Profile
 
 
Posted: 06 October 2008 08:21 AM   [ Ignore ]   [ # 3 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  172
Joined  07-16-2005

There are definitely little quirks that need to be worked out. I’ve run into a few cases as well and I’ll update this thread if I can find them. I saw a tweet somewhere that said Huot is hoarding an updated version over at Happy Cog. I think Jason mentioned it…

 Signature 

///////////////////////////////////////////////////////////////////////

+ Travis Schmeisser

nGen Works

+ rockthenroll

///////////////////////////////////////////////////////////////////////

Structure: a new way to build ExpressionEngine sites

Profile
 
 
Posted: 06 October 2008 08:22 AM   [ Ignore ]   [ # 4 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1726
Joined  03-26-2006

Out of curiosity, what method are you using to render the field with Textile? Are you setting th field to Textile in the Control Panel, or are you wrapping the output with textile tags on the template?

 Signature 

ryan masuga
—————
Masuga Design | Member, EE Pro Network
My EE Add-Ons | {devot:ee}
Twitter: masuga | masugadesign | devot_ee

Profile
 
 
Posted: 06 October 2008 08:31 AM   [ Ignore ]   [ # 5 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1726
Joined  03-26-2006

I used your example content in a textile field I have on a local install. I definitely didn’t have any issue getting the blockquote to work on the first line, although I did have to put a space between the link and the n-dash (or whatever that was) to get the link to show correctly.

I’m setting the field formatting to Textile in the Control Panel, rather than on the template, though not sure if that makes a difference.

 Signature 

ryan masuga
—————
Masuga Design | Member, EE Pro Network
My EE Add-Ons | {devot:ee}
Twitter: masuga | masugadesign | devot_ee

Profile
 
 
Posted: 06 October 2008 08:39 AM   [ Ignore ]   [ # 6 ]  
Grad Student
Avatar
Rank
Total Posts:  38
Joined  04-27-2007
rockthenroll - 06 October 2008 08:21 AM

There are definitely little quirks that need to be worked out. I’ve run into a few cases as well and I’ll update this thread if I can find them.

That’d be awesome, Travis—please do.

mdesign - 06 October 2008 08:22 AM

Out of curiosity, what method are you using to render the field with Textile? Are you setting th field to Textile in the Control Panel, or are you wrapping the output with textile tags on the template?

That part of the template basically looks like this:

<dd class="message">
    
{exp:textile}
    {comment}
    {
/exp:textile}
</dd><!-- /end dd.message -->

I don’t actually know where to set that value in the CP. Mind giving me a pointer?

 Signature 

Ethan is a Senior Designer at Airbag Industries, LLC., and wants to be an unstoppable robot ninja when he grows up.

Beep.

Profile
 
 
Posted: 06 October 2008 08:52 AM   [ Ignore ]   [ # 7 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1726
Joined  03-26-2006

Ah…I have never used the textile tags on the template side. I made a quick screencast for you (about a minute, quicktime) showing how to add textile or markdown via the control panel so you can get rid of the tags on your templates.

Add Textile/Markdown in the Control Panel

 Signature 

ryan masuga
—————
Masuga Design | Member, EE Pro Network
My EE Add-Ons | {devot:ee}
Twitter: masuga | masugadesign | devot_ee

Profile
 
 
Posted: 06 October 2008 08:57 AM   [ Ignore ]   [ # 8 ]  
Grad Student
Avatar
Rank
Total Posts:  38
Joined  04-27-2007

Hey, Ryan—thanks for the screencast. However, the problem I’m having is on comment fields, not entry/custom fields.

Still, if the first line bug isn’t occurring on entry fields, that’s important information. Thanks.

 Signature 

Ethan is a Senior Designer at Airbag Industries, LLC., and wants to be an unstoppable robot ninja when he grows up.

Beep.

Profile
 
 
Posted: 06 October 2008 06:52 PM   [ Ignore ]   [ # 9 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  324
Joined  03-18-2007

Also you should know that the demo site for the newest version of textile is here: http://textile.thresholdstate.com/

Profile
 
 
Posted: 06 October 2008 07:00 PM   [ Ignore ]   [ # 10 ]  
Grad Student
Avatar
Rank
Total Posts:  38
Joined  04-27-2007
slapshotw - 06 October 2008 06:52 PM

Also you should know that the demo site for the newest version of textile is here: http://textile.thresholdstate.com/

Thanks, slapshotw—couldn’t find the 2.0 link before. Thank you.

Still, this raises another issue: EE’s implementation adds unnecessary markup to any HTML elements that might already be in the input.

For example, with this input:

bq. Another sample.

A *simple* example.

<
p>
How does this do with <a href="http://unstoppablerobotninja.com/">preexisting links</a>?
</
p>

Textile should give me:

  <blockquote>
      <p>Another sample.</p>
  </blockquote>

  <p>A <strong>simple</strong> example.</p>

<p>
How does this do with <a href=“http://unstoppablerobotninja.com/”>proper links</a>?<br />
</p>

Instead, EE yields:

<p>    <blockquote>
        <
p>Another sample.</p>
    </
blockquote>

    <
p>A <strong>simple</strong> example.</p>

<
p>
How does this do with <a href="http://unstoppablerobotninja.com/?URL=http://unstoppablerobotninja.com/">preexisting links</a>?<br />
</
p></p>

 Signature 

Ethan is a Senior Designer at Airbag Industries, LLC., and wants to be an unstoppable robot ninja when he grows up.

Beep.

Profile
 
 
Posted: 06 October 2008 07:15 PM   [ Ignore ]   [ # 11 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  324
Joined  03-18-2007

Could there be any kind of linebreak before or after your text that’s causing Textile to think it should all be wrapped in a <p>?

(Just saw your signature by the way. Nice to see you on here. I was a big fan of the old Vertua site/work—and of course feel the same way about Airbag.)

Profile
 
 
Posted: 06 October 2008 08:32 PM   [ Ignore ]   [ # 12 ]  
Grad Student
Avatar
Rank
Total Posts:  38
Joined  04-27-2007
slapshotw - 06 October 2008 07:15 PM

Could there be any kind of linebreak before or after your text that’s causing Textile to think it should all be wrapped in a <p>?

Unfortunately, no. For what it’s worth, I’ve spoken to a few other EE folks about this, and they’re having the same problems.

slapshotw - 06 October 2008 07:15 PM

(Just saw your signature by the way. Nice to see you on here. I was a big fan of the old Vertua site/work—and of course feel the same way about Airbag.)

Well, darn—thanks so much, sir. I believe I now owe you five dollars. :D

 Signature 

Ethan is a Senior Designer at Airbag Industries, LLC., and wants to be an unstoppable robot ninja when he grows up.

Beep.

Profile
 
 
Posted: 07 October 2008 04:07 PM   [ Ignore ]   [ # 13 ]  
Grad Student
Avatar
Rank
Total Posts:  38
Joined  04-27-2007

Is this happening to anyone else? I’ve spoken to other folks offline about this, but I’d be interested to hear if this is reproducible by anyone else on the forums.

Alternately, it’d be great to hear that there’s an updated, Textile 2.0-compliant version of the plugin in the works. wink

 Signature 

Ethan is a Senior Designer at Airbag Industries, LLC., and wants to be an unstoppable robot ninja when he grows up.

Beep.

Profile
 
 
Posted: 08 October 2008 12:43 AM   [ Ignore ]   [ # 14 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  144
Joined  11-30-2004

beep, comment text has formatting applied by default, just as custom fields do. Make sure you’ve set the formatting to none in the weblog settings (in the “Comment Posting Preferences” area). I’ve attached a screenshot of the preference.

Image Attachments
textformatting.jpg
Click thumbnail to see full-size image
Profile
 
 
Posted: 08 October 2008 06:33 AM   [ Ignore ]   [ # 15 ]  
Grad Student
Avatar
Rank
Total Posts:  38
Joined  04-27-2007
Sean Sperte - 08 October 2008 12:43 AM

beep, comment text has formatting applied by default, just as custom fields do. Make sure you’ve set the formatting to none in the weblog settings (in the “Comment Posting Preferences” area). I’ve attached a screenshot of the preference.

Sean, thank you for the response. However, I’d already set the formatting to “None” in all relevant sections. Again, I’m inclined to think that this isn’t a problem with my configuration, but the plugin. Though I’d love to be proven wrong.

 Signature 

Ethan is a Senior Designer at Airbag Industries, LLC., and wants to be an unstoppable robot ninja when he grows up.

Beep.

Profile
 
 
Posted: 12 October 2008 11:31 PM   [ Ignore ]   [ # 16 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  324
Joined  03-18-2007

Ethan—did you get my PM?

Profile
 
 
Posted: 13 October 2008 07:35 AM   [ Ignore ]   [ # 17 ]  
Grad Student
Avatar
Rank
Total Posts:  38
Joined  04-27-2007

Hi, slapshotw—sorry, I just saw it. I’d actually started another thread in the Bug forum since then, which seems to be providing a few answers.

 Signature 

Ethan is a Senior Designer at Airbag Industries, LLC., and wants to be an unstoppable robot ninja when he grows up.

Beep.

Profile
 
 
Posted: 25 October 2008 12:48 PM   [ Ignore ]   [ # 18 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1726
Joined  03-26-2006

@beep: This may help you (or anyone else) tying to format comments with textile or markdown: There’s a Comment Text Formatting extension out there. Usage looks like this:

{exp:comment:entries sort="asc" limit="20" format="textile"}
{comment}
<p>By {name} on {comment_date format="%Y %m %d"}</p>
{/exp:comment:entries}


Might not help with how the textile plugin works with comments, but hey.

 Signature 

ryan masuga
—————
Masuga Design | Member, EE Pro Network
My EE Add-Ons | {devot:ee}
Twitter: masuga | masugadesign | devot_ee

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64912 Total Logged-in Users: 28
Total Topics: 81863 Total Anonymous Users: 19
Total Replies: 440100 Total Guests: 205
Total Posts: 521963    
Members ( View Memberlist )
Newest Members:  bjmohrAqua193Bios Elementmjpoteetguimogranwelshmrcfthenetmonkeybenekwhobutsb