Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.

Commit 39973ee

Browse files
committed
ensure dt elements have an id set
1 parent 3d04cbb commit 39973ee

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

_includes/javascript.html

+13
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,16 @@
1212
ga('create', 'UA-37305346-2', 'auto');
1313
ga('send', 'pageview');
1414
</script>
15+
<script>
16+
$('dt').each(function () {
17+
if (!this.id) {
18+
var id = $(this).text();
19+
var index = id.indexOf('(');
20+
if (index > 0) {
21+
id = id.substring(0, index);
22+
}
23+
id = id.trim().replace(/ /g, '-').toLowerCase();
24+
this.id = id;
25+
}
26+
});
27+
</script>

0 commit comments

Comments
 (0)