Skip to content

Commit

Permalink
chore(kumascript): remove empty anchor links
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner committed Oct 13, 2023
1 parent d0bcc90 commit 5225110
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kumascript/src/api/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5225110

Please sign in to comment.