[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] ClothRed (HTML to Textile

Phillip Gawlowski

4/10/2007 5:39:00 PM

I'm pleased to announce, that I've begun working on a small library to
convert HTML into Textile.

Please forgive me, that this announcement isn't yet following the
community's standards, but I'm slowly getting there.

For the curious, the website and project on RuybForge have gone online
*and* have some content[0].

For the impatient:
ClothRed will be exactly the reverse of RedCloth: It will grab any HTML
string, and convert it into Textile.

As a bonus, ClothRed will strip all HTML that is not being converted
into Textile's markup from the text, making it, hopefully, usable for
sanitizing HTML.

I hope to have an Alpha release out by the end of next month.

Links:
[0] http://clothred.ruby...

--
Phillip "CynicalRyan" Gawlowski
http://cynicalryan....

Rule of Open-Source Programming #5:

A project is never finished.


3 Answers

Jacob Fugal

4/10/2007 6:49:00 PM

0

On 4/10/07, Phillip Gawlowski <cmdjackryan@googlemail.com> wrote:
> I'm pleased to announce, that I've begun working on a small library to
> convert HTML into Textile.
...
> ClothRed will be exactly the reverse of RedCloth: It will grab any HTML
> string, and convert it into Textile.
>
> As a bonus, ClothRed will strip all HTML that is not being converted
> into Textile's markup from the text, making it, hopefully, usable for
> sanitizing HTML.
>
> I hope to have an Alpha release out by the end of next month.

Awesome, Phillip. I really look forward to using this!

Jacob Fugal

Daniel DeLorme

4/12/2007 2:09:00 AM

0

Phillip Gawlowski wrote:
> ClothRed will be exactly the reverse of RedCloth: It will grab any HTML
> string, and convert it into Textile.
>
> As a bonus, ClothRed will strip all HTML that is not being converted
> into Textile's markup from the text, making it, hopefully, usable for
> sanitizing HTML.

Looks interesting, but I hope there would be a mode to preserve unknown
HTML in addition to the "lossy" mode. Sanitizing HTML is good but if you
convert the resulting Textile to HTML and it doesn't look like the
original, that's not too good IMHO.

Daniel

Phillip Gawlowski

4/12/2007 6:48:00 AM

0

Daniel DeLorme wrote:

> Looks interesting, but I hope there would be a mode to preserve unknown
> HTML in addition to the "lossy" mode. Sanitizing HTML is good but if you
> convert the resulting Textile to HTML and it doesn't look like the
> original, that's not too good IMHO.

To do that, there'll probably be two different modes of HTML stripping:
* One "strict": Every thing that cannot be parsed by ClothRed will be
thrown out.
* One "loose": All HTML that ClothRed cannot preserve will be kept, and
warnings will be emitted (either to stdout, or stderr, or both).

The latter will not be usable for sanitizing HTML, as "unknown" HTML
*should* be treated as malicious (specifically, as there is no "unknown"
HTML in the W3C specs).

--
Phillip "CynicalRyan" Gawlowski
http://cynicalryan....

Rule of Open-Source Programming #33:

Don't waste time on writing test cases and test scripts - your users are
your best testers.