diminish7 / rave

A Google Wave robot client framework for Ruby
http://github.com/diminish7/rave
MIT License
62 stars 8 forks source link

Add blip text as HTML, Textile, Markdown #19

Open bil-bas opened 14 years ago

bil-bas commented 14 years ago

Currently, we can only set_text and append_text in plain text. Wave also accepts text as HTML and so, if we use a markup generator (textile/markdown) to convert those markups into HTML, we can send them too.

blip.set_text("- *frog* _eats_ a -fish-", :format => :textile)
bil-bas commented 14 years ago

Yep, this is done and dusted (HTML and Textile). Added Redcloth to the build, but it isn't bloated so I hope that isn't a problem.

bil-bas commented 14 years ago

RedCloth has some issues with converting some special characters to HTML (e.g. '&#xxx' format), which are displayed unchanged by Wave. Either need to turn off that conversion or manually return tags to the original character after RedCloth has parsed.

bil-bas commented 14 years ago

Checked what Java does and it just trims the tags out and adds that to the local content. If we do this (or continue with the currently better, but still inaccurate, method) then really we need to put a "incorrect" flag on the text. Any attempts to further modify it, except append_text or set_text should be prevented, since it is likely to cause corruption of the text that is actually stored by wave.