main
km0 3 years ago
parent f88582f134
commit d1151385c4

@ -159,10 +159,15 @@ ol li {
text-align: center; text-align: center;
} }
.contents { .contents,
.download {
margin: 2rem auto; margin: 2rem auto;
} }
a {
text-decoration: none;
}
a.purple, a.purple,
a.orange { a.orange {
display: inline-block; display: inline-block;

@ -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);
} }
} }
}

Loading…
Cancel
Save