[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

simple markup to html

Hans Mueller

5/31/2007 7:50:00 AM

trying to convert simple markup to html, works fine with
the commands below but hyperlinks (e.g. http:// or mailto:)
in the markup aren't transferred to html (e.g. <a href="">).
Anything missing?

require 'rdoc/markup/simple_markup'
require 'rdoc/markup/simple_markup/to_html'
markup = SM::SimpleMarkup.new
formatter = SM::ToHtml.new
puts markup.convert(ARGF.read, formatter)

--
Posted via http://www.ruby-....

1 Answer

Hans Mueller

6/4/2007 6:29:00 AM

0


> trying to convert simple markup to html, works fine with
> the commands below but hyperlinks (e.g. http:// or mailto:)
> in the markup aren't transferred to html (e.g. <a href="">).
> Anything missing?
>
> require 'rdoc/markup/simple_markup'
> require 'rdoc/markup/simple_markup/to_html'
> markup = SM::SimpleMarkup.new
> formatter = SM::ToHtml.new
> puts markup.convert(ARGF.read, formatter)

ok, I found the "class HyperlinkHtml < SM::ToHtml" in
"rdoc/generators/html_generator.rb" which makes the job
with some minor modifications.

HM