Good news! SuperRedCloth is down to just five failing tests! I was down to 10 or so in mid-February but then I added test cases from "The official reference manual for Textile 2", which added 97 new tests, many of them failing. I''m happy to say, they''re almost all passing now. Four of these last five I just need to check with you on before I deviate from Textile 2.0 (as published at Threshold State).>> name: nested pre tags >> in: |- >> <pre> >> <code> >> Properly escaped here. >> >> <pre> >> a = 1 >> </pre> >> >> Still in the pre. >> </code> >> </pre> > > 1) Failure: > test_code_nested_pre_tags(TestParser) > [./test/helper.rb:54:in `assert_equal'' > ./test/helper.rb:11:in `assert_html_equal'' > ./test/test_parser.rb:16:in `test_code_nested_pre_tags'']: > expected: "<pre><code> Properly escaped here. <pre> a = > 1 </pre> Still in the pre.</code></pre>" > but was: "<pre><code> Properly escaped here. <pre> a = > 1 </pre> Still in the pre.<p></code><br /></pre></p>"I''m just too lazy to fix this.> 2) Failure: > test_threshold_footnotes(TestParser) > [./test/helper.rb:54:in `assert_equal'' > ./test/helper.rb:11:in `assert_html_equal'' > ./test/test_parser.rb:16:in `test_threshold_footnotes'']: > expected: "<p>A footnote reference<sup class=\"footnote\"><a href= > \"#fn1216642796463b1223ae29d\">1</a></sup>.</p><p id= > \"fn1216642796463b1223ae29d\" class=\"footnote\"><sup>1</sup> The > footnote.</p>" > but was: "<p>A footnote reference<sup><a href=\"#fn1\">1</a></ > sup>.</p><p id=\"fn1\"><sup>1</sup> The footnote.</p>" > > 3) Failure: > test_threshold_modifier_without_whitespace_4(TestParser) > [./test/helper.rb:54:in `assert_equal'' > ./test/helper.rb:11:in `assert_html_equal'' > ./test/test_parser.rb:16:in > `test_threshold_modifier_without_whitespace_4'']: > expected: "<p>A close<img src=\"/img.gif\" alt=\"\" />image.<br />A > tight<a href=\"http://thresholdstate.com/\">text</a>link.<br />A <a > href=\"http://thresholdstate.com/\">footnoted link</a><sup class= > \"footnote\"><a href=\"#fn1216642796463b1223ae29d\">1</a></sup>.</p>" > but was: "<p>A close<img src=\"/img.gif\" alt=\"\" />image.<br />A > tight<a href=\"http://thresholdstate.com/\">text</a>link.<br />A <a > href=\"http://thresholdstate.com/\">footnoted link</a><sup><a href= > \"#fn1\">1</a></sup>.</p>"Evidently Textile 2 generates a unique id for footnotes, I assume so you can have different sections on one web page and their footnotes won''t conflict as ids or named anchors. I could see how it could be desirable, though, to refer to a footnote and list it in different sections (rendered by RedCloth separately). What do you think?>> name: notextile tags >> desc: Blocks enclosed by the pseudo tag <notextile>...</notextile> >> will be left untouched. >> in: |- >> <notextile> >> p. Leave me alone >> </notextile> >> out: |- >> <p> >> p. Leave me alone >> </p> >> note: This syntax is supported for backwards compatibility only, >> and doesn?t always work as expected. The block modifier notextile. >> should be used instead. > > 4) Failure: > test_threshold_notextile_tags(TestParser) > [./test/helper.rb:54:in `assert_equal'' > ./test/helper.rb:11:in `assert_html_equal'' > ./test/test_parser.rb:16:in `test_threshold_notextile_tags'']: > expected: "<p>p. Leave me alone</p>" > but was: "p. Leave me alone"Here, even though it protects the contents of the <notextile> tags, it wraps the whole thing in a <p> tag. I disagree, and so does RedCloth (why added the test for it at [141].>> name: paragraphs partly enclosed in xhtml block tags >> desc: Paragraphs that are only partly enclosed in block tags will >> be enclosed in <p>...</p> tags. >> in: <div>inside</div> and outside. >> out: <p><div>inside</div> and outside.</p> > > 5) Failure: > test_threshold_paragraphs_partly_enclosed_in_xhtml_block_tags > (TestParser) > [./test/helper.rb:54:in `assert_equal'' > ./test/helper.rb:11:in `assert_html_equal'' > ./test/test_parser.rb:16:in > `test_threshold_paragraphs_partly_enclosed_in_xhtml_block_tags'']: > expected: "<p><div>inside</div> and outside.</p>" > but was: "<div>inside</div><p>and outside.</p>"Isn''t a div inside a p invalid? SRC is smart enough to not wrap a block element in a P tag. If that div were a span, SRC would enclose it just fine:> "<p><span>inside</span> and outside.</p>"> 376 tests, 376 assertions, 5 failures, 0 errorsAwesome. So, unless you tell me otherwise, I plan to: 1.) Stay lazy and throw away the test for nested pre tags. If someone has a problem with it, they''ll complain and submit a patch. 2.) Leave footnotes with simple ids (no generated unique ids) 3.) Leave notextile tag handling as it was in RedCloth and is in SRC 4.) Stick with SRC''s smarter handling of block tags in a paragraph Note: If you try compiling SRC trunk, you''ll need to have Ragel newer than 6.0 (i.e. you''ll need to check out the trunk). SRC uses leaving actions in scanners, which will be released in Ragel 6.1. Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20080310/b82ebd3f/attachment.html
I agree with all the options. Baby needs (re)birth. On release, please add the generated c files to the gem to avoid ragel dependency. A 2Mb download is easier then installing ragel from svn ! Gaspard 2008/3/10, Jason Garber <jg at jasongarber.com>:> Good news! SuperRedCloth is down to just five failing tests! I was down to > 10 or so in mid-February but then I added test cases from "The official > reference manual for Textile 2", which added 97 new tests, many of them > failing. I''m happy to say, they''re almost all passing now. > > Four of these last five I just need to check with you on before I deviate > from Textile 2.0 (as published at Threshold State). > > > > name: nested pre tags > in: |- > <pre> > <code> > Properly escaped here. > > <pre> > a = 1 > </pre> > > Still in the pre. > </code> > </pre> > > > > 1) Failure: > test_code_nested_pre_tags(TestParser) > [./test/helper.rb:54:in `assert_equal'' > ./test/helper.rb:11:in `assert_html_equal'' > ./test/test_parser.rb:16:in `test_code_nested_pre_tags'']: > expected: "<pre><code> Properly escaped here. <pre> a = 1 > </pre> Still in the pre.</code></pre>" > but was: "<pre><code> Properly escaped here. <pre> a = 1 </pre> > Still in the pre.<p></code><br /></pre></p>" > > I''m just too lazy to fix this. > > > 2) Failure: > test_threshold_footnotes(TestParser) > [./test/helper.rb:54:in `assert_equal'' > ./test/helper.rb:11:in `assert_html_equal'' > ./test/test_parser.rb:16:in `test_threshold_footnotes'']: > expected: "<p>A footnote reference<sup class=\"footnote\"><a > href=\"#fn1216642796463b1223ae29d\">1</a></sup>.</p><p > id=\"fn1216642796463b1223ae29d\" class=\"footnote\"><sup>1</sup> The > footnote.</p>" > but was: "<p>A footnote reference<sup><a > href=\"#fn1\">1</a></sup>.</p><p id=\"fn1\"><sup>1</sup> > The footnote.</p>" > > 3) Failure: > test_threshold_modifier_without_whitespace_4(TestParser) > [./test/helper.rb:54:in `assert_equal'' > ./test/helper.rb:11:in `assert_html_equal'' > ./test/test_parser.rb:16:in > `test_threshold_modifier_without_whitespace_4'']: > expected: "<p>A close<img src=\"/img.gif\" alt=\"\" />image.<br />A tight<a > href=\"http://thresholdstate.com/\">text</a>link.<br />A <a > href=\"http://thresholdstate.com/\">footnoted link</a><sup > class=\"footnote\"><a href=\"#fn1216642796463b1223ae29d\">1</a></sup>.</p>" > but was: "<p>A close<img src=\"/img.gif\" alt=\"\" />image.<br />A tight<a > href=\"http://thresholdstate.com/\">text</a>link.<br />A <a > href=\"http://thresholdstate.com/\">footnoted link</a><sup><a > href=\"#fn1\">1</a></sup>.</p>" > > Evidently Textile 2 generates a unique id for footnotes, I assume so you can > have different sections on one web page and their footnotes won''t conflict > as ids or named anchors. I could see how it could be desirable, though, to > refer to a footnote and list it in different sections (rendered by RedCloth > separately). What do you think? > > > > name: notextile tags > desc: Blocks enclosed by the pseudo tag <notextile>...</notextile> will be > left untouched. > in: |- > <notextile> > p. Leave me alone > </notextile> > out: |- > <p> > p. Leave me alone > </p> > note: This syntax is supported for backwards compatibility only, and doesn''t > always work as expected. The block modifier notextile. should be used > instead. > > > 4) Failure: > test_threshold_notextile_tags(TestParser) > [./test/helper.rb:54:in `assert_equal'' > ./test/helper.rb:11:in `assert_html_equal'' > ./test/test_parser.rb:16:in > `test_threshold_notextile_tags'']: > expected: "<p>p. Leave me alone</p>" > but was: "p. Leave me alone" > > Here, even though it protects the contents of the <notextile> tags, it wraps > the whole thing in a <p> tag. I disagree, and so does RedCloth (why added > the test for it at [141]. > > > > name: paragraphs partly enclosed in xhtml block tags > desc: Paragraphs that are only partly enclosed in block tags will be > enclosed in <p>...</p> tags. > in: <div>inside</div> and outside. > out: <p><div>inside</div> and outside.</p> > > > 5) Failure: > test_threshold_paragraphs_partly_enclosed_in_xhtml_block_tags(TestParser) > [./test/helper.rb:54:in `assert_equal'' > ./test/helper.rb:11:in `assert_html_equal'' > ./test/test_parser.rb:16:in > `test_threshold_paragraphs_partly_enclosed_in_xhtml_block_tags'']: > expected: "<p><div>inside</div> and outside.</p>" > but was: "<div>inside</div><p>and outside.</p>" > > Isn''t a div inside a p invalid? SRC is smart enough to not wrap a block > element in a P tag. If that div were a span, SRC would enclose it just > fine: > "<p><span>inside</span> and outside.</p>" > > 376 tests, 376 assertions, 5 failures, 0 errorsAwesome. > > So, unless you tell me otherwise, I plan to: > 1.) Stay lazy and throw away the test for nested pre tags. If someone has a > problem with it, they''ll complain and submit a patch. > 2.) Leave footnotes with simple ids (no generated unique ids) > 3.) Leave notextile tag handling as it was in RedCloth and is in SRC > 4.) Stick with SRC''s smarter handling of block tags in a paragraph > > Note: If you try compiling SRC trunk, you''ll need to have Ragel newer than > 6.0 (i.e. you''ll need to check out the trunk). SRC uses leaving actions in > scanners, which will be released in Ragel 6.1. > > Jason > > > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards >
PS: thanks for the great work ! Gaspard 2008/3/11, Gaspard Bucher <gaspard at teti.ch>:> I agree with all the options. Baby needs (re)birth. > > On release, please add the generated c files to the gem to avoid ragel > dependency. A 2Mb download is easier then installing ragel from svn ! > > Gaspard > > 2008/3/10, Jason Garber <jg at jasongarber.com>: > > > Good news! SuperRedCloth is down to just five failing tests! I was down to > > 10 or so in mid-February but then I added test cases from "The official > > reference manual for Textile 2", which added 97 new tests, many of them > > failing. I''m happy to say, they''re almost all passing now. > > > > Four of these last five I just need to check with you on before I deviate > > from Textile 2.0 (as published at Threshold State). > > > > > > > > name: nested pre tags > > in: |- > > <pre> > > <code> > > Properly escaped here. > > > > <pre> > > a = 1 > > </pre> > > > > Still in the pre. > > </code> > > </pre> > > > > > > > > 1) Failure: > > test_code_nested_pre_tags(TestParser) > > [./test/helper.rb:54:in `assert_equal'' > > ./test/helper.rb:11:in `assert_html_equal'' > > ./test/test_parser.rb:16:in `test_code_nested_pre_tags'']: > > expected: "<pre><code> Properly escaped here. <pre> a = 1 > > </pre> Still in the pre.</code></pre>" > > but was: "<pre><code> Properly escaped here. <pre> a = 1 </pre> > > Still in the pre.<p></code><br /></pre></p>" > > > > I''m just too lazy to fix this. > > > > > > 2) Failure: > > test_threshold_footnotes(TestParser) > > [./test/helper.rb:54:in `assert_equal'' > > ./test/helper.rb:11:in `assert_html_equal'' > > ./test/test_parser.rb:16:in `test_threshold_footnotes'']: > > expected: "<p>A footnote reference<sup class=\"footnote\"><a > > href=\"#fn1216642796463b1223ae29d\">1</a></sup>.</p><p > > id=\"fn1216642796463b1223ae29d\" class=\"footnote\"><sup>1</sup> The > > footnote.</p>" > > but was: "<p>A footnote reference<sup><a > > href=\"#fn1\">1</a></sup>.</p><p id=\"fn1\"><sup>1</sup> > > The footnote.</p>" > > > > 3) Failure: > > test_threshold_modifier_without_whitespace_4(TestParser) > > [./test/helper.rb:54:in `assert_equal'' > > ./test/helper.rb:11:in `assert_html_equal'' > > ./test/test_parser.rb:16:in > > `test_threshold_modifier_without_whitespace_4'']: > > expected: "<p>A close<img src=\"/img.gif\" alt=\"\" />image.<br />A tight<a > > href=\"http://thresholdstate.com/\">text</a>link.<br />A <a > > href=\"http://thresholdstate.com/\">footnoted link</a><sup > > class=\"footnote\"><a href=\"#fn1216642796463b1223ae29d\">1</a></sup>.</p>" > > but was: "<p>A close<img src=\"/img.gif\" alt=\"\" />image.<br />A tight<a > > href=\"http://thresholdstate.com/\">text</a>link.<br />A <a > > href=\"http://thresholdstate.com/\">footnoted link</a><sup><a > > href=\"#fn1\">1</a></sup>.</p>" > > > > Evidently Textile 2 generates a unique id for footnotes, I assume so you can > > have different sections on one web page and their footnotes won''t conflict > > as ids or named anchors. I could see how it could be desirable, though, to > > refer to a footnote and list it in different sections (rendered by RedCloth > > separately). What do you think? > > > > > > > > name: notextile tags > > desc: Blocks enclosed by the pseudo tag <notextile>...</notextile> will be > > left untouched. > > in: |- > > <notextile> > > p. Leave me alone > > </notextile> > > out: |- > > <p> > > p. Leave me alone > > </p> > > note: This syntax is supported for backwards compatibility only, and doesn''t > > always work as expected. The block modifier notextile. should be used > > instead. > > > > > > 4) Failure: > > test_threshold_notextile_tags(TestParser) > > [./test/helper.rb:54:in `assert_equal'' > > ./test/helper.rb:11:in `assert_html_equal'' > > ./test/test_parser.rb:16:in > > `test_threshold_notextile_tags'']: > > expected: "<p>p. Leave me alone</p>" > > but was: "p. Leave me alone" > > > > Here, even though it protects the contents of the <notextile> tags, it wraps > > the whole thing in a <p> tag. I disagree, and so does RedCloth (why added > > the test for it at [141]. > > > > > > > > name: paragraphs partly enclosed in xhtml block tags > > desc: Paragraphs that are only partly enclosed in block tags will be > > enclosed in <p>...</p> tags. > > in: <div>inside</div> and outside. > > out: <p><div>inside</div> and outside.</p> > > > > > > 5) Failure: > > test_threshold_paragraphs_partly_enclosed_in_xhtml_block_tags(TestParser) > > [./test/helper.rb:54:in `assert_equal'' > > ./test/helper.rb:11:in `assert_html_equal'' > > ./test/test_parser.rb:16:in > > `test_threshold_paragraphs_partly_enclosed_in_xhtml_block_tags'']: > > expected: "<p><div>inside</div> and outside.</p>" > > but was: "<div>inside</div><p>and outside.</p>" > > > > Isn''t a div inside a p invalid? SRC is smart enough to not wrap a block > > element in a P tag. If that div were a span, SRC would enclose it just > > fine: > > "<p><span>inside</span> and outside.</p>" > > > > 376 tests, 376 assertions, 5 failures, 0 errorsAwesome. > > > > So, unless you tell me otherwise, I plan to: > > 1.) Stay lazy and throw away the test for nested pre tags. If someone has a > > problem with it, they''ll complain and submit a patch. > > 2.) Leave footnotes with simple ids (no generated unique ids) > > 3.) Leave notextile tag handling as it was in RedCloth and is in SRC > > 4.) Stick with SRC''s smarter handling of block tags in a paragraph > > > > Note: If you try compiling SRC trunk, you''ll need to have Ragel newer than > > 6.0 (i.e. you''ll need to check out the trunk). SRC uses leaving actions in > > scanners, which will be released in Ragel 6.1. > > > > Jason > > > > > > > _______________________________________________ > > Redcloth-upwards mailing list > > Redcloth-upwards at rubyforge.org > > http://rubyforge.org/mailman/listinfo/redcloth-upwards > > >
i''m just a forum lurker (no ragel skillz here), but my input --> 2.) Leave footnotes with simple ids (no generated unique ids)I agree -- really, if you''ve got two footnotes marked "n1" on the same page, you''ve already got problems from a user''s perspective. adding the unique ids makes the page happy (unique html IDs) but not the user (um, which footnote 1 is this?).> 4.) Stick with SRC''s smarter handling of block tags in a paragraphyay, this is one of the things that always bothered me about RC (and various PHP textile implementations). i can''t tell you how excited i am that we''ll have a proper (test-passing) redcloth. thanks for pushing this along jason ... we owe you. d