added capitilization
This commit is contained in:
parent
ddb3e0565f
commit
2bc401934e
@ -48,21 +48,21 @@ for( var a = 0; a < wordsReplaced.length; a++ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(var b = 0; b < wordsReplaced.length; b++) {
|
for(var b = 0; b < wordsReplaced.length; b++) {
|
||||||
var amountFound = html.match(reg);
|
var reg2 = new RegExp(wordsReplaced[b], "gi");
|
||||||
for(var c = 0; c < amountFound.length; c++) {
|
var amountFound = html.match(reg2);
|
||||||
var reg2pattern = "([^" + wordsReplaced[b] + "]*" + wordsReplaced[b] + "){" + c + "}";
|
if(html.match(reg2) !== null) {
|
||||||
var reg2 = new RegExp(reg2pattern, "i");
|
var reg3 = new RegExp(wordsReplacer[b], "g");
|
||||||
if (html.match(reg2) !== null && amountFound[c][0] === amountFound[c][0].toUpperCase()) {
|
var match, indexes= [];
|
||||||
var reg3 = new RegExp(wordsReplacer[])
|
while (match= reg3.exec(htmlReplaced)) {
|
||||||
|
indexes.push([match.index, match.index+match[0].length]);
|
||||||
var getIndex = htmlReplaced.match(reg3)[0].length - wordsReplacer[d].length;
|
}
|
||||||
var changeCase = htmlReplaced[getIndex].toUpperCase();
|
for(var c = 0; c < amountFound.length; c++) {
|
||||||
htmlReplaced = htmlReplaced.replaceAt(getIndex, changeCase);
|
if (amountFound[c][0] === amountFound[c][0].toUpperCase()) {
|
||||||
|
var changeCase = htmlReplaced[indexes[c][0]].toUpperCase();
|
||||||
|
htmlReplaced = htmlReplaced.replaceAt(indexes[c][0], changeCase);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
document.documentElement.innerHTML = htmlReplaced;
|
document.documentElement.innerHTML = htmlReplaced;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user