Use textContent instead of innerText
This commit is contained in:
parent
53220af68e
commit
5a5c18371c
@ -52,7 +52,7 @@ const audioUrlBuilders = new Map([
|
|||||||
for (const row of dom.getElementsByClassName('dc-result-row')) {
|
for (const row of dom.getElementsByClassName('dc-result-row')) {
|
||||||
try {
|
try {
|
||||||
const url = row.querySelector('audio>source[src]').getAttribute('src');
|
const url = row.querySelector('audio>source[src]').getAttribute('src');
|
||||||
const reading = row.getElementsByClassName('dc-vocab_kana').item(0).innerText;
|
const reading = row.getElementsByClassName('dc-vocab_kana').item(0).textContent;
|
||||||
if (url && reading && (!definition.reading || definition.reading === reading)) {
|
if (url && reading && (!definition.reading || definition.reading === reading)) {
|
||||||
return audioUrlNormalize(url, 'https://www.japanesepod101.com', '/learningcenter/reference/');
|
return audioUrlNormalize(url, 'https://www.japanesepod101.com', '/learningcenter/reference/');
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ class QueryParserGenerator {
|
|||||||
const segmentTextContainer = segmentContainer.querySelector('.query-parser-segment-text');
|
const segmentTextContainer = segmentContainer.querySelector('.query-parser-segment-text');
|
||||||
const segmentReadingContainer = segmentContainer.querySelector('.query-parser-segment-reading');
|
const segmentReadingContainer = segmentContainer.querySelector('.query-parser-segment-reading');
|
||||||
segmentTextContainer.appendChild(this.createSegmentText(segment.text));
|
segmentTextContainer.appendChild(this.createSegmentText(segment.text));
|
||||||
segmentReadingContainer.innerText = segment.reading;
|
segmentReadingContainer.textContent = segment.reading;
|
||||||
return segmentContainer;
|
return segmentContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ class QueryParserGenerator {
|
|||||||
const fragment = document.createDocumentFragment();
|
const fragment = document.createDocumentFragment();
|
||||||
for (const chr of text) {
|
for (const chr of text) {
|
||||||
const charContainer = this._templateHandler.instantiate('char');
|
const charContainer = this._templateHandler.instantiate('char');
|
||||||
charContainer.innerText = chr;
|
charContainer.textContent = chr;
|
||||||
fragment.appendChild(charContainer);
|
fragment.appendChild(charContainer);
|
||||||
}
|
}
|
||||||
return fragment;
|
return fragment;
|
||||||
@ -69,7 +69,7 @@ class QueryParserGenerator {
|
|||||||
for (const parseResult of parseResults) {
|
for (const parseResult of parseResults) {
|
||||||
const optionContainer = this._templateHandler.instantiate('select-option');
|
const optionContainer = this._templateHandler.instantiate('select-option');
|
||||||
optionContainer.value = parseResult.id;
|
optionContainer.value = parseResult.id;
|
||||||
optionContainer.innerText = parseResult.name;
|
optionContainer.textContent = parseResult.name;
|
||||||
optionContainer.defaultSelected = selectedParser === parseResult.id;
|
optionContainer.defaultSelected = selectedParser === parseResult.id;
|
||||||
selectContainer.appendChild(optionContainer);
|
selectContainer.appendChild(optionContainer);
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ function docImposterCreate(element, isTextarea) {
|
|||||||
const imposter = document.createElement('div');
|
const imposter = document.createElement('div');
|
||||||
const imposterStyle = imposter.style;
|
const imposterStyle = imposter.style;
|
||||||
|
|
||||||
imposter.innerText = element.value;
|
imposter.textContent = element.value;
|
||||||
|
|
||||||
for (let i = 0, ii = elementStyle.length; i < ii; ++i) {
|
for (let i = 0, ii = elementStyle.length; i < ii; ++i) {
|
||||||
const property = elementStyle[i];
|
const property = elementStyle[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user