mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
contentcollector: Invert logic to improve readability
This commit is contained in:
parent
b811030846
commit
b547ce9a47
1 changed files with 19 additions and 23 deletions
|
@ -251,7 +251,7 @@ const makeContentCollector = (collectStyles, abrowser, apool, className2Author)
|
||||||
const _recalcAttribString = (state) => {
|
const _recalcAttribString = (state) => {
|
||||||
const lst = [];
|
const lst = [];
|
||||||
for (const [a, count] of Object.entries(state.attribs)) {
|
for (const [a, count] of Object.entries(state.attribs)) {
|
||||||
if (count) {
|
if (!count) continue;
|
||||||
// The following splitting of the attribute name is a workaround
|
// The following splitting of the attribute name is a workaround
|
||||||
// to enable the content collector to store key-value attributes
|
// to enable the content collector to store key-value attributes
|
||||||
// see https://github.com/ether/etherpad-lite/issues/2567 for more information
|
// see https://github.com/ether/etherpad-lite/issues/2567 for more information
|
||||||
|
@ -270,7 +270,6 @@ const makeContentCollector = (collectStyles, abrowser, apool, className2Author)
|
||||||
lst.push([a, 'true']);
|
lst.push([a, 'true']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (state.authorLevel > 0) {
|
if (state.authorLevel > 0) {
|
||||||
const authorAttrib = ['author', state.author];
|
const authorAttrib = ['author', state.author];
|
||||||
if (apool.putAttrib(authorAttrib, true) >= 0) {
|
if (apool.putAttrib(authorAttrib, true) >= 0) {
|
||||||
|
@ -498,12 +497,9 @@ const makeContentCollector = (collectStyles, abrowser, apool, className2Author)
|
||||||
if (!rr && !type) {
|
if (!rr && !type) {
|
||||||
for (let i = 0; i < dom.numChildNodes(node); i++) {
|
for (let i = 0; i < dom.numChildNodes(node); i++) {
|
||||||
const child = dom.childNode(node, i);
|
const child = dom.childNode(node, i);
|
||||||
if (child.name === 'ul') {
|
if (child.name !== 'ul') continue;
|
||||||
type = dom.getAttribute(child, 'class');
|
type = dom.getAttribute(child, 'class');
|
||||||
if (type) {
|
if (type) break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rr && rr[1]) {
|
if (rr && rr[1]) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue