@@ -174,16 +174,16 @@ def index_l10n_doc(filter_tags, doc_list, get_content)
174
174
175
175
# HTML anchor on hdlist1 (i.e. command options)
176
176
html . gsub! ( /<dt class="hdlist1">(.*?)<\/ dt>/ ) do |_m |
177
- dt_content = $1
178
- text = dt_content . gsub ( /<\/ ?[^>]+>/ , "" ) . tr ( "^A-Za-z0-9-" , "" )
177
+ inner_html = $1
178
+ text = inner_html . gsub ( /<\/ ?[^>]+>/ , "" ) . tr ( "^A-Za-z0-9-" , "" )
179
179
# use txt_path for backward compatibility of already-existing
180
180
# deep links shared across the interwebs.
181
181
anchor = "#{ txt_path } -#{ text } "
182
182
# handle anchor collisions by appending -1
183
183
anchor += "-1" while ids . include? ( anchor )
184
184
ids . add ( anchor )
185
185
186
- "<dt class=\" hdlist1\" id=\" #{ anchor } \" > <a class=\" anchor\" href=\" ##{ anchor } \" ></a>#{ $1 } </dt>"
186
+ "<dt class=\" hdlist1\" id=\" #{ anchor } \" > <a class=\" anchor\" href=\" ##{ anchor } \" ></a>#{ inner_html } </dt>"
187
187
end
188
188
# Make links relative
189
189
html . gsub! ( /(<a href=['"])\/ ([^'"]*)/ ) do |match |
@@ -466,15 +466,15 @@ def index_doc(filter_tags, doc_list, get_content)
466
466
end
467
467
# HTML anchor on hdlist1 (i.e. command options)
468
468
html . gsub! ( /<dt class="hdlist1">(.*?)<\/ dt>/ ) do |_m |
469
- dt_content = $1
470
- text = dt_content . gsub ( /<\/ ? [^>]+>/ , "" ) . tr ( "^A-Za-z0-9-" , "" )
469
+ inner_html = $1
470
+ text = inner_html . gsub ( /<[^>]+>/ , "" ) . tr ( "^A-Za-z0-9-" , "" )
471
471
# use txt_path for backward compatibility of already-existing
472
472
# deep links shared across the interwebs.
473
473
anchor = "#{ txt_path } -#{ text } "
474
474
# handle anchor collisions by appending -1
475
475
anchor += "-1" while ids . include? ( anchor )
476
476
ids . add ( anchor )
477
- "<dt class=\" hdlist1\" id=\" #{ anchor } \" > <a class=\" anchor\" href=\" ##{ anchor } \" ></a>#{ $1 } </dt>"
477
+ "<dt class=\" hdlist1\" id=\" #{ anchor } \" > <a class=\" anchor\" href=\" ##{ anchor } \" ></a>#{ inner_html } </dt>"
478
478
end
479
479
# Make links relative
480
480
html . gsub! ( /(<a href=['"])\/ ([^'"]*)/ ) do |relurl |
0 commit comments