Przeglądaj źródła

Respect original ID with ToC (#11895)

master^2
Yamagishi Kazutoshi 4 lat temu
committed by Eugen Rochko
rodzic
commit
73a5ef03b2
1 zmienionych plików z 1 dodań i 1 usunięć
  1. +1
    -1
      app/lib/toc_generator.rb

+ 1
- 1
app/lib/toc_generator.rb Wyświetl plik

@@ -45,7 +45,7 @@ class TOCGenerator
parsed_html.traverse do |node|
next unless TARGET_ELEMENTS.include?(node.name)

anchor = node.text.parameterize
anchor = node['id'] || node.text.parameterize
@slugs[anchor] += 1
anchor = "#{anchor}-#{@slugs[anchor]}" if @slugs[anchor] > 1



Ładowanie…
Anuluj
Zapisz