diff --git a/Doc/.latex2html-init b/Doc/.latex2html-init index 774f3a79444..749e8226355 100644 --- a/Doc/.latex2html-init +++ b/Doc/.latex2html-init @@ -139,24 +139,26 @@ sub bot_navigation_panel { } -# similar to make_index_entry(), but includes the string in the result -# instead of the dummy filler. -# -sub make_str_index_entry { +sub gen_index_id { + # this is used to ensure common index key generation and a stable sort + local($str,$extra) = @_; + sprintf("%s###%s%010d", $str, $extra, ++$global{'max_id'}); +} + +sub make_index_entry { local($br_id,$str) = @_; - # If TITLE is not yet available (i.e the \index command is in the title - # of the current section), use $ref_before. + # If TITLE is not yet available (i.e the \index command is in the title of the + # current section), use $ref_before. $TITLE = $ref_before unless $TITLE; # Save the reference - local($nstr) = "$str###" . ++$global{'max_id'}; # Make unique - $index{$nstr} .= &make_half_href("$CURRENT_FILE#$br_id"); - "$str<\/a>"; + $str = gen_index_id($str, ''); + $index{$str} .= &make_half_href("$CURRENT_FILE#$br_id"); + "$anchor_invisible_mark<\/a>"; } sub add_idx { print "\nDoing the index ..."; - local($key, $str, @keys, $index, $level, $count, - @previous, @current); + local($key, $str, @keys, $index, $level, $count, @previous, @current); @keys = keys %index; @keys = sort keysort @keys; $level = 0; @@ -180,12 +182,12 @@ sub add_idx { $level++; } $str = $current[$#current]; - $str =~ s/\#\#\#\d+$//o; # Remove the unique id's - $index .= #$index{$key} . - # If it's the same string don't start a new line - (&index_key_eq(join('',@current), join('',@previous)) ? - ", $index{$key}" . $cross_ref_visible_mark . "\n" : - "