mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 17:36:14 -04:00
contentcollector: Fix parent node access
The `parent` property is only available on cheerio's Node-like objects; DOM Node objects do not have a `parent` property. Switch to the `parentNode` property so that the code works in browsers as well as cheerio.
This commit is contained in:
parent
1d36549152
commit
e3ec9d9a4c
1 changed files with 2 additions and 2 deletions
|
@ -519,7 +519,7 @@ const makeContentCollector = (collectStyles, abrowser, apool, className2Author)
|
|||
Note how the <ol> item has to be inside a <li>
|
||||
Because of this we don't increment the start number
|
||||
*/
|
||||
if (node.parent && node.parent.name !== 'ol') {
|
||||
if (node.parentNode && node.parentNode.name !== 'ol') {
|
||||
/*
|
||||
TODO: start number has to increment based on indentLevel(numberX)
|
||||
This means we have to build an object IE
|
||||
|
@ -536,7 +536,7 @@ const makeContentCollector = (collectStyles, abrowser, apool, className2Author)
|
|||
}
|
||||
}
|
||||
// UL list items never modify the start value.
|
||||
if (node.parent && node.parent.name === 'ul') {
|
||||
if (node.parentNode && node.parentNode.name === 'ul') {
|
||||
state.start++;
|
||||
// TODO, this is hacky.
|
||||
// Because if the first item is an UL it will increment a list no?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue