From ffab2edc5b67d7248fabe75cc5cf26945c6ef190 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Sat, 10 Feb 2024 17:16:16 +0100 Subject: [PATCH] Use safe navigation --- src/core/prism.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/prism.ts b/src/core/prism.ts index 940f3b89c..1abfe1146 100644 --- a/src/core/prism.ts +++ b/src/core/prism.ts @@ -109,7 +109,7 @@ export class Prism { this.hooks.run('after-highlight', env); this.hooks.run('complete', env); - callback && callback(env.element); + callback?.(env.element); }; this.hooks.run('before-sanity-check', env); @@ -122,7 +122,7 @@ export class Prism { if (!env.code) { this.hooks.run('complete', env); - callback && callback(env.element); + callback?.(env.element); return; }