#162 open
Gabor Garami

Fault tolerance when a block is embedded in a paragraph.

Reported by Gabor Garami | July 26th, 2009 @ 04:59 AM

The notextile tag is not works correctly.

Reproducible: always
Steps to reproduce:

  1. Create file with content like this:
    Mailbox code
    <notextile><pre>
    

Warning: The database defined as "test" will be erased and

re-generated from your development database when you run "rake".

Do not set this db to the same as development or production.

test: adapter: mysql database: webadmin_test host: localhost username: xxxxxx password: xxxxx </pre> </notextile> 2. Run redcloth on this file:
redcloth testfile.textile
3. result:

<p>Mailbox code<br />
<pre></p>
<ol>

&lt;li&gt;Warning: The database defined as &amp;#8220;test&amp;#8221; will be erased and&lt;/li&gt;
&lt;li&gt;re-generated from your development database when you run &amp;#8220;rake&amp;#8221;.&lt;/li&gt;
&lt;li&gt;Do not set this db to the same as development or production.&lt;br /&gt;



test:<br /> adapter: mysql<br /> database: webadmin_test<br /> host: localhost<br /> username: webadmin<br /> password: webadmin<br /> </pre><br /> </notextile></li> </ol>

Versions:
ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]
RedCloth 4.2.2

Comments and changes to this ticket

  • Gabor Garami

    Gabor Garami July 26th, 2009 @ 05:05 AM

    The base problem seems is a # and space in a line. This is a problem, because if i include code into the text, it can contain a comment (what can begins a # and a space )

  • Jason Garber

    Jason Garber July 27th, 2009 @ 09:04 AM

    • Tag changed from notextile to fault-tolerence, notextile
    • State changed from “new” to “open”

    No, the problem is that you're not following the "every block must be followed by a blank line" rule. The parser encounters "Mailbox code" and says, "oh, it's a paragraph," but then it encounters another block signature and gets confused.

    This works as intended:

    Mailbox code
    
    <notextile><pre>
    # Warning: The database defined as "test" will be erased and
    # re-generated from your development database when you run "rake".
    # Do not set this db to the same as development or production.
    test:
      adapter: mysql
      database: webadmin_test
      host: localhost
      username: xxxxxx
      password: xxxxx
    </pre>
    </notextile>
    

    In fact, you don't even need the notextile tags. RedCloth passes things in PRE tags through with almost no modification.

    RedCloth should probably be more fault-tolerant, so I'm going to leave this ticket open, but I consider your problem solved.

  • Jason Garber

    Jason Garber July 27th, 2009 @ 09:05 AM

    • Title changed from “notextile is not works correctly” to “Fault tolerance when a block is embedded in a paragraph.”
  • Gabor Garami

    Gabor Garami July 27th, 2009 @ 09:14 AM

    Okay, i accept this solution.

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

Pages