From 5225110c362ac3441124d04b5abf6af6ef1ea838 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Fri, 13 Oct 2023 11:20:24 +0200 Subject: [PATCH] chore(kumascript): remove empty anchor links --- kumascript/src/api/util.ts | 5 +++++ 1 file changed, 5 insertions(+) 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)