-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
cURL language #1160
Comments
Hi! Could you give an example of what you mean by "cURL language" ? AFAIK it's not a language... |
I see. The closest we have would probably be the Bash component. But I'm afraid it won't do such a great job. :/ |
Well, actually I expected something worse. The easy thing we can do to improve highlighting is to add the |
As previously stated, I've added If you really want to highlight cURL the way Stripe does it, you can still take a look at their custom language definition: https://stripe.com/assets/compiled/js/sprockets-js-documentation-c4b3ec3ed7e62075f018.min.js. // Prism curl
Prism.languages.curl = {
'curl': /\bcurl\b/,
'url': /https?:[a-zA-Z0-9:.?=\/\-_{}]*/,
'parameter': {
pattern: /[A-Za-z0-9\[\]-_]+ *(?=[=])/,
},
'value': [{
pattern: /([=])([A-Za-z0-9-_.]*)/,
lookbehind: true,
}, {
pattern: /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
}, {
pattern: /(\-u )([A-Za-z0-9-_.{}]*)/,
lookbehind: true,
}],
'option': / *-[a-zA-Z]*\b/,
}; |
@Golmote I took a look at my previous code and I found a solution for the Bash language:
and this part of SASS code (or CSS):
Hope it will help someone 😄 |
Why not add this to PrismJS this would be an amazing PR |
@chakrihacker If you're interested in opening a PR, we're always open to new language additions. |
This would be awesome to add cURL syntax highlighting. Almost every REST API has cURL examples, it would solve so many issues. |
Hello :-)
Is there a way to highlight cURL language?
Thanks!
The text was updated successfully, but these errors were encountered: