Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(clojure) comment macro should not be comment scope #3395

Merged
merged 2 commits into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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")