1// var links = document.querySelectorAll("a.button") 2 3// links.forEach(function (link) { 4// // Create a temporary span to measure text width 5// var span = document.createElement("span") 6// span.style.visibility = "hidden" // Hide the span 7// span.style.whiteSpace = "nowrap" // Prevent wrapping 8// span.style.font = window.getComputedStyle(link).font // Use the same font styles as the link 9// span.textContent = link.textContent.trim() // Set the text content of the span 10// document.body.appendChild(span) // Append to the body to measure width 11 12// // Get the width of the text 13// var textWidth = span.offsetWidth 14// console.log(textWidth) 15 16// // Remove the temporary span 17// document.body.removeChild(span) 18 19// // Set a CSS variable (custom property) on the element 20// link.style.setProperty("--text-width", textWidth + "px") 21// })
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.