rdoc icon indicating copy to clipboard operation
rdoc copied to clipboard

Inline HTML extension in Markdown generator not working

Open sawshep opened this issue 3 years ago • 2 comments

I cannot get the inline HTML extension to work with the standalone RDoc Markdown generator. Below is a test using the example from the documentation. The expected output should have <time>2022-09-08</time> instead of &lt;time&gt;2022-09-08&lt;/time&gt;.

Here's the full example:

irb(main):002:0> RDoc::Markdown::DEFAULT_EXTENSIONS
=> [:definition_lists, :github, :html, :notes, :strike]
irb(main):003:0> markdown = "<time>2022-09-08</time>\nhello there!"
=> "<time>2022-09-08</time>\nhello there!"
irb(main):004:0> formatter = RDoc::Markup::ToHtml.new(RDoc::Options.new, nil)
=> 
#<RDoc::Markup::ToHtml:0x00007fd82520a7b0                                               
...                                                                                                       
irb(main):005:0> html = RDoc::Markdown.parse(markdown).accept(formatter)
=> "\n<p>&lt;time&gt;2022-09-08&lt;/time&gt; hello there!</p>\n"

sawshep avatar Aug 10 '22 00:08 sawshep

I don't think <time> is a valid HTML tag.

nobu avatar Aug 10 '22 03:08 nobu

Sorry, I didn't know it was added by HTML 5.

nobu avatar Aug 10 '22 03:08 nobu