Skip to content

Ampersand in TOC still doesn't render correctly  #696

@enthusiasmus

Description

@enthusiasmus

Hi!

Thanks for this great gem!

The following test should succeed, but it doesn't. Instead of #main-bar the output contains only #main. One can use this test to implement the feature. Unfortunately my C skills are kind of rusty.

class HTMLTOCRenderTest < Redcarpet::TestCase
  ...
  def test_converting_ampersand_correctly
    markdown = "# Main & Headline"
    output = render(markdown)
    assert output.match("<a href=\"#main-bar\">Main & Headline</a>")
  end
end

Would be great!
Best regards,
Lukas

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions