FEATURE: Add anchor links to headings (#12379)

This commit is contained in:
Bianca Nenciu
2021-03-23 10:45:06 +02:00
committed by GitHub
parent e48d055232
commit 2ad9b3f432
7 changed files with 66 additions and 8 deletions

View File

@@ -1903,4 +1903,17 @@ HTML
expect(cooked).to eq(html.strip)
end
end
it "adds anchor links to headings" do
cooked = PrettyText.cook('# Hello world')
html = <<~HTML
<h1>
<a name="hello-world" class="anchor" href="#hello-world"></a>
Hello world
</h1>
HTML
expect(cooked).to match_html(html)
end
end