views:

14

answers:

0

I'm working in the Insitiki code and trying to extend the maruku syntax to generate some custom html tags.

Example:

|youtube 0FWPr6u8YF |

Should print the html code as follows:

<object data='http://www.youtube.com/v/01hcB2zmMqM' style='width:425px; height:350px;' type='application/x-shockwave-flash'><param name='movie' value='http://www.youtube.com/v/01hcB2zmMqM'/&gt;&lt;/object&gt;

Thus giving me a youtube embbeded video.

To make it work I followed this tutorial http://maruku.rubyforge.org/extending/extensions.html and looked at maruku documentation.

THE PROBLEM is, using the maruku method:

context.push(doc.md_html("<p>raw html</p>"))

The resulting html code is escaped, so what I get is verbatim text and not the raw html that I wanted.

I tried changing the strategy and using something like:

context.push(doc.md_el(:raw_html,[],:raw_html => "<p> raw raw raw </p>")

To no use ... what I get now is: REXML could not parse this XML/HTML:

Found nothing on this issue, the maruku docs are really thin (or I'm really bad at searching)... this guy seems to have a similar problem http://stackoverflow.com/questions/1973717/textile-and-maruku-problem

Any help is appreciated.