Skip to content

Commit

Permalink
Use safe navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Feb 10, 2024
1 parent 54ef4cd commit ffab2ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/prism.ts
Expand Up @@ -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);
Expand All @@ -122,7 +122,7 @@ export class Prism {

if (!env.code) {
this.hooks.run('complete', env);
callback && callback(env.element);
callback?.(env.element);
return;
}

Expand Down

0 comments on commit ffab2ed

Please sign in to comment.