The in-line script searches contents of the body
of the page for capitalised words with two or more characters, and when found, wraps them in abbr
opening and closing html tags, which can then be made to look like small caps.
This following script can be added to the head
section of a page enclosed within opening and closing script
tags.
window.onload = scotf;
function scotf() {
document.body.innerHTML=document.body.innerHTML.replace(/[A-Z]{2,}/g, '<abbr>$&</abbr>');}
abbr {
letter-spacing:0.3ch; /* adjust as appropriate */
font-size: 81%; /* adjust as appropriate */
}
Last updated: 2020-02-21 16:33
ckunte