Skip to content

Commit dd89e01

Browse files
authored
Merge pull request #2012 from git/fix_refs_anchor_links
fix the automatic generation of anchors in the reference doc
2 parents e574bfb + f240847 commit dd89e01

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

script/update-docs.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,10 +487,10 @@ def index_doc(filter_tags, doc_list, get_content)
487487
clean_anchor = "#{txt_path}-#{clean_text}"
488488
clean_anchor += "-1" while ids.include?(clean_anchor)
489489
ids.add(clean_anchor)
490-
clean_anchor = "<a class=\"anchor\" href=\"##{clean_anchor}\"></a> "
490+
"<dt class=\"hdlist1\" id=\"#{anchor}\"><a id=\"#{clean_anchor}\" class=\"anchor\" href=\"##{clean_anchor}\"></a>#{$1} </dt>"
491+
else
492+
"<dt class=\"hdlist1\" id=\"#{anchor}\"><a class=\"anchor\" href=\"##{anchor}\"></a>#{$1} </dt>"
491493
end
492-
493-
"<dt class=\"hdlist1\" id=\"#{anchor}\"> #{clean_anchor}<a class=\"anchor\" href=\"##{anchor}\"></a>#{$1} </dt>"
494494
end
495495
# Make links relative
496496
html.gsub!(/(<a href=['"])\/([^'"]*)/) do |relurl|

0 commit comments

Comments
 (0)