mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Add anchor links to headings (#12379)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user