Skip to content

Commit

Permalink
fix(clojure) comment macro should not be comment scope (#3395)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrEbbinghaus committed Nov 9, 2021
1 parent 99e05df commit 1d8031b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.md
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion src/languages/clojure.js
Expand Up @@ -132,7 +132,6 @@ export default function(hljs) {
};

LIST.contains = [
hljs.COMMENT('comment', ''),
GLOBAL,
NAME,
BODY
Expand Down
2 changes: 2 additions & 0 deletions test/markup/clojure/comment-macro.expect.txt
@@ -0,0 +1,2 @@
(<span class="hljs-name">comment</span> <span class="hljs-string">&quot;comment is a macro that emits no code. It can contain clojure code in itself.&quot;</span>)
(<span class="hljs-name">comment-and-something</span> <span class="hljs-string">&quot;This is a valid function name&quot;</span>)
2 changes: 2 additions & 0 deletions 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")

0 comments on commit 1d8031b

Please sign in to comment.