0
This repository has been archived on 2024-08-27. You can view files and clone it, but cannot push or open issues or pull requests.
highlight_js-rails/vendor/assets/javascripts/highlight_js/languages/http.js
2015-01-25 16:00:01 +01:00

41 lines
983 B
JavaScript

/*
Language: HTTP
Description: HTTP request and response headers with automatic body highlighting
Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
Category: common, protocols
*/
function(hljs) {
return {
illegal: '\\S',
contains: [
{
className: 'status',
begin: '^HTTP/[0-9\\.]+', end: '$',
contains: [{className: 'number', begin: '\\b\\d{3}\\b'}]
},
{
className: 'request',
begin: '^[A-Z]+ (.*?) HTTP/[0-9\\.]+$', returnBegin: true, end: '$',
contains: [
{
className: 'string',
begin: ' ', end: ' ',
excludeBegin: true, excludeEnd: true
}
]
},
{
className: 'attribute',
begin: '^\\w', end: ': ', excludeEnd: true,
illegal: '\\n|\\s|=',
starts: {className: 'string', end: '$'}
},
{
begin: '\\n\\n',
starts: {subLanguage: '', endsWithParent: true}
}
]
};
}