Skip to content

Commit

Permalink
Add jq hljs highlighting (exercism#6875)
Browse files Browse the repository at this point in the history
* Add jq hljs highlighting

* Add jq to transformIgnorePatterns
  • Loading branch information
dem4ron authored Apr 10, 2024
1 parent f8747dc commit 2d19fd6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/javascript/declarations/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,10 @@ declare module '@exercism/highlightjs-gdscript' {

export default setup
}

declare module 'highlightjs-jq' {
import { LanguageFn } from 'highlight.js'
const setup: LanguageFn

export default setup
}
2 changes: 2 additions & 0 deletions app/javascript/utils/highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import setupBallerina from '@ballerina/highlightjs-ballerina'
import setupRed from 'highlightjs-redbol'
import setupChapel from 'highlightjs-chapel'
import setupGDScript from '@exercism/highlightjs-gdscript'
import setupJq from 'highlightjs-jq'

if (areAllRegExpFeaturesSupported()) {
highlighter.default.registerLanguage('abap', setupABAP)
Expand All @@ -21,6 +22,7 @@ if (areAllRegExpFeaturesSupported()) {
highlighter.default.registerLanguage('red', setupRed)
highlighter.default.registerLanguage('chapel', setupChapel)
highlighter.default.registerLanguage('gdscript', setupGDScript)
highlighter.default.registerLanguage('jq', setupJq)
}

highlighter.default.configure({
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config = {
'^.+\\.[t|j]sx?$': 'babel-jest',
},
transformIgnorePatterns: [
'node_modules/(?!(highlightjs-(bqn|zig|chapel)|@ballerina/highlightjs-ballerina)/)',
'node_modules/(?!(highlightjs-(bqn|zig|chapel|jq)|@ballerina/highlightjs-ballerina)/)',
],
moduleNameMapper: {
'^[./a-zA-Z0-9$_-]+\\.svg$':
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"highlightjs-bqn": "^0.0.1",
"highlightjs-chapel": "^0.1.0",
"highlightjs-cobol": "^0.3.1",
"highlightjs-jq": "^0.1.0",
"highlightjs-redbol": "^2.1.2",
"highlightjs-sap-abap": "^0.2.0",
"highlightjs-zig": "^1.0.2",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5477,6 +5477,11 @@ highlightjs-cobol@^0.3.1:
minimist ">=1.2.6"
mkdirp "^1.0.4"

highlightjs-jq@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/highlightjs-jq/-/highlightjs-jq-0.1.0.tgz#27440623b1a89a2f078c669e0c56faa9d6a2320b"
integrity sha512-XgaRaETm28jC7gD3pn8A3b7/hHoYdSeXT2XOqByutegzpevl1lVS4kqiYRS6/IIzAdMOIrgj00cl0AiC4AtFmg==

highlightjs-redbol@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/highlightjs-redbol/-/highlightjs-redbol-2.1.2.tgz#5f4eb1fdcf9c7259d9cc1337b231272b2fe7621e"
Expand Down

0 comments on commit 2d19fd6

Please sign in to comment.