From 4ddfbe4bd469d582c7577e73f859d56334361bde Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 9 Dec 2021 10:40:17 -0500 Subject: [PATCH] enh(js/ts) fix => async function title highlights (#3414) --- CHANGES.md | 1 + src/languages/javascript.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index de2488e9ea..262bc2100a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ Grammars: +- enh(js/ts) fix => async function title highlights (#3405) [Josh Goebel][] - enh(twig) update keywords list (#3415) [Matthieu Lempereur][] - fix(python) def, class keywords detected mid-identifier (#3381) [Josh Goebel][] - fix(python) Fix recognition of numeric literals followed by keywords without whitespace (#2985) [Richard Gibson][] diff --git a/src/languages/javascript.js b/src/languages/javascript.js index b09065dd85..b3282e1725 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -406,8 +406,10 @@ export default function(hljs) { /const|var|let/, /\s+/, IDENT_RE, /\s*/, /=\s*/, + /(async\s*)?/, // async is optional regex.lookahead(FUNC_LEAD_IN_RE) ], + keywords: "async", className: { 1: "keyword", 3: "title.function"