Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private loop() {
// At first, clear the event queue for adding funcs to execute in next frame
const events = this.animationEvents
this.animationEvents = []
// Execute registered events
for (const func of events) func()
// Finally trigger marp-core's fitting
MarpBrowser(false)
if (this.dispatched) this.requestAnimationFrame()
}
if (marpVscode) {
document.body.classList.add('marp-vscode')
// Remove default styles
const styles = document.querySelectorAll(
'style:not(#marp-vscode-style):not(#_defaultStyles)'
)
const links = document.querySelectorAll(
'link[rel="stylesheet"]:not([href*="marp-vscode"])'
)
styles.forEach(elm => elm.remove())
links.forEach(elm => elm.remove())
// Run Marp observer
browserCjs()
}
}