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