rdoc
rdoc copied to clipboard
Inline HTML extension in Markdown generator not working
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 <time>2022-09-08</time>.
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><time>2022-09-08</time> hello there!</p>\n"
I don't think <time> is a valid HTML tag.
Sorry, I didn't know it was added by HTML 5.