mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Change from replacement regex to actually searching for the name
Makes it work in more scenarios, and also removes the stropping
This commit is contained in:
parent
c2a47b323f
commit
62d43fb875
1 changed files with 2 additions and 2 deletions
|
@ -54,8 +54,8 @@ module Docs
|
|||
else
|
||||
|
||||
css('.simple-toc-section a, .nested-toc-section a').each do |node|
|
||||
entry_name = node.content
|
||||
entry_name.gsub!(/(\(|\[).*/, '')
|
||||
match = /^`(.*)`|^(\w+)/.match(node.content)
|
||||
entry_name = match[1] || match[2]
|
||||
|
||||
entry_id = slug + node['href']
|
||||
entries << [entry_name, entry_id, name]
|
||||
|
|
Loading…
Reference in a new issue