Sha256: 3ef09d40646e220ff0860ba28ee430a71570d3e7704affdcb748bbd78e78aefe

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

/*
  Language: HTTP
  Description: HTTP request and response headers with automatic body highlighting
  Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
*/

hljs.LANGUAGES['http'] = function(hljs) {
  return {
    defaultMode: {
      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',
          starts: {className: 'string', end: '$'}
        },
        {
          begin: '\\n\\n',
          starts: {subLanguage: '', endsWithParent: true}
        }
      ]
    }
  };
}(hljs);

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
highlight_js-rails-7.1.0 vendor/assets/javascripts/highlight_js/languages/http.js