Skip to content

Commit 62d43fb

Browse files
committed
Change from replacement regex to actually searching for the name
Makes it work in more scenarios, and also removes the stropping
1 parent c2a47b3 commit 62d43fb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/docs/filters/nim/entries.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ def additional_entries
5454
else
5555

5656
css('.simple-toc-section a, .nested-toc-section a').each do |node|
57-
entry_name = node.content
58-
entry_name.gsub!(/(\(|\[).*/, '')
57+
match = /^`(.*)`|^(\w+)/.match(node.content)
58+
entry_name = match[1] || match[2]
5959

6060
entry_id = slug + node['href']
6161
entries << [entry_name, entry_id, name]

0 commit comments

Comments
 (0)