Open bendavis78 opened 4 years ago
I modified the code and replaced current implementation with the following in my script:
function lineNumbersBlock (element, options) {
if (typeof element !== 'object') return;
return new Promise((resolve, reject) => {
element.innerHTML = lineNumbersInternal(element, options);
resolve();
})
}
and it forks for me ¯\_(ツ)_/¯
I'm trying to use this in conjunction with printedjs, but it doesn't work because this library manipulates dom in a setTimeout(). Is there a good reason this needs to be wrapped in a setTimeout? If so, why not use promises? That would give us more control over the situation.