#185 ✓resolved

Block code creates separate <code> tags for code with two new lines in it

Reported by Brandon | March 2nd, 2010 @ 05:51 PM

If you have something like this:

bc.. code line 1

code line 2

It's converted into this:

<pre><code>code line 1</code>

<code>code line 2</code></pre>

I can only assume this is intentional, but I'm not sure why? Semantically it doesn't seem to make sense. They aren't separate code blocks, they're one code block separated by a blank line. Do you (or does anyone) know why Textile creates multiple <code> elements?

Comments and changes to this ticket

  • Jason Garber

    Jason Garber March 3rd, 2010 @ 01:52 PM

    • State changed from “new” to “resolved”

    No idea. That's just the way it is in PHP Textile (see http://textile.thresholdstate.com/) and we try to match the original as much as possible.

    I think it follows the same implementation as extended blockquotes.

    bq.. One thing
    And another
    <p>One thing</p>
    <p>And another</p>
  • Paweł Gościcki

    Paweł Gościcki March 3rd, 2010 @ 05:11 PM

    This is intended. Both for blockquote and pre tags. The two dots open up a multi-line blockquote/pre mode. Without it, you would need to use html tags to achieve separate paragraphs in a blockquote. It's a very handy feature.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

RedCloth is a Ruby library for converting Textile into HTML

Shared Ticket Bins

People watching this ticket