refactoring
This commit is contained in:
@@ -62,16 +62,13 @@ export const FocusClasses = Extension.create({
|
|||||||
|
|
||||||
currentLevel += 1
|
currentLevel += 1
|
||||||
|
|
||||||
const isOutOfScope = typeof this.options.levels === 'number'
|
const outOfScope = typeof this.options.levels === 'number'
|
||||||
&& (
|
&& (
|
||||||
this.options.start === 'shallow'
|
(this.options.start === 'deep' && maxLevels - currentLevel > this.options.levels)
|
||||||
? currentLevel > this.options.levels
|
|| (this.options.start === 'shallow' && currentLevel > this.options.levels)
|
||||||
: maxLevels - currentLevel > this.options.levels
|
|
||||||
)
|
)
|
||||||
|
|
||||||
console.log(node.type.name, currentLevel, maxLevels, this.options.levels)
|
if (outOfScope) {
|
||||||
|
|
||||||
if (isOutOfScope) {
|
|
||||||
return this.options.start === 'deep'
|
return this.options.start === 'deep'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user