diff --git a/src/assets/wise5/common/wise-link/wise-link.spec.ts b/src/assets/wise5/common/wise-link/wise-link.spec.ts index 1fc9015900b..480b56df764 100644 --- a/src/assets/wise5/common/wise-link/wise-link.spec.ts +++ b/src/assets/wise5/common/wise-link/wise-link.spec.ts @@ -148,5 +148,5 @@ function createWiseLinkReplacedByElement( componentId: string, linkText: string ): string { - return `<${tag} wiselink="true" onclick="document.getElementById('replace-with-unique-id').dispatchEvent(new CustomEvent('wiselinkclicked', { detail: { nodeId: '${nodeId}', componentId: '${componentId}' } })); return false;">${linkText}`; + return `<${tag} wiselink="true" node-id="${nodeId}" component-id="${componentId}" onclick="document.getElementById('replace-with-unique-id').dispatchEvent(new CustomEvent('wiselinkclicked', { detail: { nodeId: '${nodeId}', componentId: '${componentId}' } })); return false;">${linkText}`; } diff --git a/src/assets/wise5/common/wise-link/wise-link.ts b/src/assets/wise5/common/wise-link/wise-link.ts index c53cc296150..2884f18baed 100644 --- a/src/assets/wise5/common/wise-link/wise-link.ts +++ b/src/assets/wise5/common/wise-link/wise-link.ts @@ -102,10 +102,11 @@ function replaceWiseLinksHelper(html: string, regex: string): string { const linkText = getWiseLinkLinkText(wiseLinkHTML); let newElement = ''; const onclickString = `document.getElementById('replace-with-unique-id').dispatchEvent(new CustomEvent('wiselinkclicked', { detail: { nodeId: '${nodeId}', componentId: '${componentId}' } })); return false;`; + const params = `wiselink="true" node-id="${nodeId}" component-id="${componentId}" onclick="${onclickString}"`; if (type === 'button') { - newElement = ``; + newElement = ``; } else { - newElement = `${linkText}`; + newElement = `${linkText}`; } html = html.replace(wiseLinkHTML, newElement); wiseLinkRegExMatchResult = wiseLinkRegEx.exec(html);