Merge pull request #16892 from Snuffleupagus/addLinkAttributes-rm-removeNullCharacters

Stop using `removeNullCharacters` in the `addLinkAttributes` helper function
This commit is contained in:
Jonas Jenwald 2023-08-31 21:52:44 +02:00 committed by GitHub
commit b5c8849111
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,7 @@
/** @typedef {import("./event_utils").EventBus} EventBus */
/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */
import { parseQueryString, removeNullCharacters } from "./ui_utils.js";
import { parseQueryString } from "./ui_utils.js";
const DEFAULT_LINK_REL = "noopener noreferrer nofollow";
@ -49,12 +49,11 @@ function addLinkAttributes(link, { url, target, rel, enabled = true } = {}) {
throw new Error('A valid "url" parameter must provided.');
}
const urlNullRemoved = removeNullCharacters(url);
if (enabled) {
link.href = link.title = urlNullRemoved;
link.href = link.title = url;
} else {
link.href = "";
link.title = `Disabled: ${urlNullRemoved}`;
link.title = `Disabled: ${url}`;
link.onclick = () => {
return false;
};