contentcollector: Use destructuring to improve readability

This commit is contained in:
Richard Hansen 2021-01-21 00:06:43 -05:00 committed by John McLear
parent b547ce9a47
commit 4e220538a1

View file

@ -425,7 +425,7 @@ const makeContentCollector = (collectStyles, abrowser, apool, className2Author)
if (tname === 'br') { if (tname === 'br') {
this.breakLine = true; this.breakLine = true;
const tvalue = dom.getAttribute(node, 'value'); const tvalue = dom.getAttribute(node, 'value');
const induceLineBreak = hooks.callAll('collectContentLineBreak', { const [startNewLine = true] = hooks.callAll('collectContentLineBreak', {
cc: this, cc: this,
state, state,
tname, tname,
@ -433,9 +433,6 @@ const makeContentCollector = (collectStyles, abrowser, apool, className2Author)
styl: null, styl: null,
cls: null, cls: null,
}); });
const startNewLine = (
typeof (induceLineBreak) === 'object' &&
induceLineBreak.length === 0) ? true : induceLineBreak[0];
if (startNewLine) { if (startNewLine) {
cc.startNewLine(state); cc.startNewLine(state);
} }