Fix: issue with some articles having less sections
This commit is contained in:
parent
b241f40b3c
commit
c647fee231
19
index.html
19
index.html
@ -10096,15 +10096,22 @@
|
|||||||
currentarticle['sections'] = {}
|
currentarticle['sections'] = {}
|
||||||
|
|
||||||
totalsections = parsedhtml.getElementById('sectionmaster').childElementCount
|
totalsections = parsedhtml.getElementById('sectionmaster').childElementCount
|
||||||
|
|
||||||
for (let j = 0; j < totalsections; j++) {
|
for (let j = 0; j < totalsections; j++) {
|
||||||
tempobj = {}
|
tempobj = {}
|
||||||
asection = parsedhtml.getElementById(`section${j + 1}`)
|
asection = parsedhtml.getElementById(`section${j + 1}`)
|
||||||
sectiontitle = asection.children[0].children[0].innerText
|
if(asection){
|
||||||
sectionpara1 = asection.children[1].innerText
|
sectiontitle = asection.children[0].children[0].innerText
|
||||||
tempobj['title'] = sectiontitle
|
sectionpara1 = asection.children[1].innerText
|
||||||
tempobj['paragraph'] = sectionpara1
|
tempobj['title'] = sectiontitle
|
||||||
currentarticle['sections'][j] = tempobj
|
tempobj['paragraph'] = sectionpara1
|
||||||
|
currentarticle['sections'][j] = tempobj
|
||||||
|
}
|
||||||
|
/* else{
|
||||||
|
parsedhtml.getElementById('sectionmaster')
|
||||||
|
console.log(j+1)
|
||||||
|
console.error(`current article with issue : ${currentarticle['title']}`)
|
||||||
|
} */
|
||||||
}
|
}
|
||||||
|
|
||||||
parsedarticles[articlekeys[i]] = currentarticle
|
parsedarticles[articlekeys[i]] = currentarticle
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user