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). >> Still in the 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. > sup>.</p><p id=\"fn1\"><sup>1</sup> The footnote.</p>" > \"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? >> </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]. > ./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 errors Awesome. 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
on 10.03.2008 23:03
on 11.03.2008 10:22
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@jasongarber.com>:
on 11.03.2008 10:23
PS: thanks for the great work ! Gaspard 2008/3/11, Gaspard Bucher <gaspard@teti.ch>:
on 11.03.2008 16:56
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 paragraph yay, 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