Skip to content

Commit 54e1874

Browse files
committed
Remove automatic id generation for h1s
This isn't doing what I wanted it to do.
1 parent 8af7d99 commit 54e1874

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

app/models/page/renderer.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,6 @@ def add_automatic_ids_to_headings(doc)
7575
h2_ids = []
7676
h3s_with_manual_ids = []
7777

78-
# h1 headers
79-
doc.search('./h1').each do |header|
80-
if (id = header['id']).blank?
81-
id = header['id'] = header.text.to_url
82-
end
83-
end
84-
8578
# h2 headers
8679
doc.search('./h2').each do |h2|
8780
if (id = h2['id']).blank?

spec/models/page/renderer_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
MD
99

1010
html = <<~HTML
11-
<h1 id="page-title">Page title</h1>
11+
<h1>Page title</h1>
1212
1313
<p>Some description</p>
1414
HTML

0 commit comments

Comments
 (0)