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