diff --git a/kumascript/src/api/util.ts b/kumascript/src/api/util.ts index 2116717e116b..0e7f0c2e9cb3 100644 --- a/kumascript/src/api/util.ts +++ b/kumascript/src/api/util.ts @@ -224,6 +224,11 @@ export class HTMLTool { $element.attr("id", id); if (isDt) { + // Remove empty anchor links. + // This happens if the term already links to a page. + $element.find("a[data-link-to-id = true]:empty").remove(); + + // Link remaining anchor links to the term's ID. $element .find("a[data-link-to-id = true]") .attr("href", "#" + id)