From: Phillip Gawlowski Date: 2007-04-14T01:24:02+09:00 Subject: Re: [ANN] ClothRed 0.3.0 released Adriano Ferreira wrote: > but that's pretty easy to work around with the simple patch attached. > I just replaced "" as a substitution to HTML , , ... by > "\n\n" producing the necessary paragraph breaks for Textile. > "test/test_headings.rb" had to be fixed and I also wrote > "test/test_misc.rb" as a test script for HTML with more than one tag > in it. Thanks. I'll add your patch ASAP, and make a new release. > The substitution approach will not work quite right for HTML where > closing tags are missing. The algorithm will never understand when the > tags were closed. So this is somewhat limited currently to XHTML which > demands closing tags. And it's buggy, I've noticed, as it ignores self-closing tags like
. I'll fix that together with your patch. > I think the suggestion of using a HTML parser (like Hpricot) to do > this conversion will impose itself pretty soon. Probably, but I'll have to play with Hpricot first, to see if it can do what is needed (after a short skim, it allows to convert HTML4 into XHTML1.0, which will make it easier). Trouble is, I want ClothRed as dependency free as I can. So maybe I'll redistribute Hpricot in non-gem distributions (if that's possible, haven't checked Hpricot's license yet). > Thanks for the inspiring work. No problem. I'll need that library for my own ideas. ;) -- Phillip "CynicalRyan" Gawlowski http://cynicalryan.110mb.com/ http://clothred.rubyforge.org Rule of Open-Source Programming #48: The number of items on a project's to-do list always grows or remains constant.