Skip to content

Commit f240847

Browse files
committed
fix the automatic generation of anchors in the reference doc
The automatic generation of anchors in the reference documentation by copilot in #2007 was wrong. What needs to be added is additional ids that can be used to link to the terms of definition lists. At the same time, the advertised anchor is change to reflect the new format. Signed-off-by: Jean-Noël Avila <[email protected]>
1 parent df368a4 commit f240847

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)