|
|
|
@ -13,14 +13,22 @@ function capitals(sentence) {
|
|
|
|
|
let content = sentence.textContent.trim();
|
|
|
|
|
|
|
|
|
|
if (content) {
|
|
|
|
|
let link = sentence.querySelector("a");
|
|
|
|
|
|
|
|
|
|
let first = content[0];
|
|
|
|
|
let rest = content.substring(1);
|
|
|
|
|
sentence.innerHTML = rest;
|
|
|
|
|
|
|
|
|
|
let capital = document.createElement("span");
|
|
|
|
|
capital.classList.add("first");
|
|
|
|
|
capital.innerHTML = first;
|
|
|
|
|
|
|
|
|
|
if (link) {
|
|
|
|
|
link.innerHTML = rest;
|
|
|
|
|
link.prepend(capital);
|
|
|
|
|
sentence.appendChild(link);
|
|
|
|
|
} else {
|
|
|
|
|
sentence.innerHTML = rest;
|
|
|
|
|
sentence.prepend(capital);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|