From 1d8031b2a59f6d9a5f9704857d953b8af8b7cf89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ebbinghaus?= Date: Tue, 9 Nov 2021 15:48:16 +0100 Subject: [PATCH] fix(clojure) comment macro should not be `comment` scope (#3395) --- CHANGES.md | 2 ++ src/languages/clojure.js | 1 - test/markup/clojure/comment-macro.expect.txt | 2 ++ test/markup/clojure/comment-macro.txt | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 test/markup/clojure/comment-macro.expect.txt create mode 100644 test/markup/clojure/comment-macro.txt diff --git a/CHANGES.md b/CHANGES.md index 5f77890137..b43a548aee 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,9 +5,11 @@ Grammars: - fix(python) Fix recognition of numeric literals followed by keywords without whitespace (#2985) [Richard Gibson][] - enh(swift) add SE-0290 unavailability condition (#3382) [Bradley Mackey][] - enh(java) add `sealed` and `non-sealed` keywords (#3386) [Bradley Mackey][] +- fix(clojure) `comment` macro catches more than it should [Björn Ebbinghaus][] [Richard Gibson]: https://github.com/gibson042 [Bradley Mackey]: https://github.com/bradleymackey +[Björn Ebbinghaus]: https://github.com/MrEbbinghaus ## Version 11.3.1 diff --git a/src/languages/clojure.js b/src/languages/clojure.js index c34d0527a6..34c9ff18af 100644 --- a/src/languages/clojure.js +++ b/src/languages/clojure.js @@ -132,7 +132,6 @@ export default function(hljs) { }; LIST.contains = [ - hljs.COMMENT('comment', ''), GLOBAL, NAME, BODY diff --git a/test/markup/clojure/comment-macro.expect.txt b/test/markup/clojure/comment-macro.expect.txt new file mode 100644 index 0000000000..55260ddbb3 --- /dev/null +++ b/test/markup/clojure/comment-macro.expect.txt @@ -0,0 +1,2 @@ +(comment "comment is a macro that emits no code. It can contain clojure code in itself.") +(comment-and-something "This is a valid function name") \ No newline at end of file diff --git a/test/markup/clojure/comment-macro.txt b/test/markup/clojure/comment-macro.txt new file mode 100644 index 0000000000..8ebcefc043 --- /dev/null +++ b/test/markup/clojure/comment-macro.txt @@ -0,0 +1,2 @@ +(comment "comment is a macro that emits no code. It can contain clojure code in itself.") +(comment-and-something "This is a valid function name") \ No newline at end of file