Skip to content

Commit

Permalink
修复目录空行
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft committed May 11, 2022
1 parent c93544e commit daf651a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions template/statics/js/docView.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,13 @@ function hCreatEle(arr, parent) {
if (!arr.length) return
var ol = document.createElement('ol')
arr.forEach(function(item) {
var li = document.createElement('li')
li.innerHTML = item.node.innerHTML
hCreatEle(item.children, li)
ol.appendChild(li)
if ('' !== item.node.innerHTML)
{
var li = document.createElement('li')
li.innerHTML = item.node.innerHTML
hCreatEle(item.children, li)
ol.appendChild(li)
}
})
parent.appendChild(ol)
}
Expand Down

0 comments on commit daf651a

Please sign in to comment.