ruby / ruby/rdoc

Inline HTML extension in Markdown generator not working

Open
#914 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
930
Forks
465
Avg merge
3d 10h
Merged PRs (30d)
27

Description

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"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the example using RDoc::Markdown.parse with RDoc::Markup::ToHtml and the documented DEFAULT_EXTENSIONS, then trace how the :html extension handles inline tags. Add a regression test showing that 2022-09-08 remains unescaped in the generated output.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.