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

EE’s Textile implementation broken? Doesn’t match “official” Textile output

Development and Programming

beep's avatar
beep
25 posts
16 years ago
beep's avatar beep

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>
    Hopefully you’ll be there.
</blockquote>

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.

This is what ExpressionEngine returns, however:


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 <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.

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 "link":URL 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.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

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.

       
beep's avatar
beep
25 posts
16 years ago
beep's avatar beep

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

       
rockthenroll's avatar
rockthenroll
485 posts
16 years ago
rockthenroll's avatar rockthenroll

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…

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

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?

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

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.

       
beep's avatar
beep
25 posts
16 years ago
beep's avatar beep
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.

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?

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

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

       
beep's avatar
beep
25 posts
16 years ago
beep's avatar beep

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.

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
16 years ago
Matt Weinberg's avatar Matt Weinberg

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

       
beep's avatar
beep
25 posts
16 years ago
beep's avatar beep
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.


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

Textile should give me:

Another sample.
A simple example. How does this do with proper links?

Instead, EE yields:

    <blockquote>
        Another sample.
    </blockquote>

    A <strong>simple</strong> example.


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

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
16 years ago
Matt Weinberg's avatar Matt Weinberg

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 ?

(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.)

       
beep's avatar
beep
25 posts
16 years ago
beep's avatar beep
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 ?

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.

(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

       
beep's avatar
beep
25 posts
16 years ago
beep's avatar beep

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. 😉

       
Sean Sperte's avatar
Sean Sperte
63 posts
16 years ago
Sean Sperte's avatar Sean Sperte

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.

       
1 2

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.