Skip to content

Added support for JQ#1896

Merged
RunDevelopment merged 13 commits intoPrismJS:masterfrom
RunDevelopment:jq
Jun 8, 2019
Merged

Added support for JQ#1896
RunDevelopment merged 13 commits intoPrismJS:masterfrom
RunDevelopment:jq

Conversation

@RunDevelopment
Copy link
Member

This adds support for the JQ language and resolves #1894.

@iilei Could you please verify that this PR highlights JQ code correctly and consistently?
I'm not familiar with JQ so someone who is looking over it would be really appreciated.

Example

image

@iilei
Copy link

iilei commented May 18, 2019

Thank you for contributing the PR so swiftly 👍

I can confirm it does a great job in highlighting also a more complex example of jq code.

Just one question or a wish, if possible – could the pipe | operator be treated similar as the vscode highlighter does? Maybe keep the operatorclass and add a pipeline-operator class too?

The | operator combines two filters by feeding the output(s) of the one on the left into the input of the one on the right. It’s pretty much the same as the Unix shell’s pipe, if you’re used to that.

jq manual

credits for the example code

Screenshot

example

@RunDevelopment
Copy link
Member Author

@iilei | and |= will now also have the pipe alias which should allow more granular highlighting.

I also changed the style of . depending on the context. I.e. .foo and .[0] will still be punctuation but a single . will be of class dot.

I hope this works for you.

@iilei
Copy link

iilei commented May 18, 2019

very cool

@RunDevelopment RunDevelopment merged commit 73d964b into PrismJS:master Jun 8, 2019
@RunDevelopment RunDevelopment deleted the jq branch June 8, 2019 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

jq

2 participants