From cde4f9a7edbf8c8e0bdcc2701f97a5b54ece22c5 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 5 Jul 2026 18:20:19 +0200 Subject: [PATCH] Don't needlessly wrap the marked content `id`-attribute in a string When the marked content `id` is defined it'll always be a string, hence wrapping it in a string when setting the attribute is pointless; note https://github.com/mozilla/pdf.js/blob/e148b154cdff4344db1bc263fe3b546b03eff5ae/src/core/evaluator.js#L3529-L3531 --- src/display/text_layer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display/text_layer.js b/src/display/text_layer.js index 257c2ced0a58a..ef67ae5af33f4 100644 --- a/src/display/text_layer.js +++ b/src/display/text_layer.js @@ -303,7 +303,7 @@ class TextLayer { this.#container = document.createElement("span"); this.#container.classList.add("markedContent"); if (item.id) { - this.#container.setAttribute("id", `${item.id}`); + this.#container.setAttribute("id", item.id); } if (item.tag === "Artifact") { this.#container.ariaHidden = true;