http.js 947 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. module.exports = function(hljs) {
  2. var VERSION = 'HTTP/[0-9\\.]+';
  3. return {
  4. aliases: ['https'],
  5. illegal: '\\S',
  6. contains: [
  7. {
  8. begin: '^' + VERSION, end: '$',
  9. contains: [{className: 'number', begin: '\\b\\d{3}\\b'}]
  10. },
  11. {
  12. begin: '^[A-Z]+ (.*?) ' + VERSION + '$', returnBegin: true, end: '$',
  13. contains: [
  14. {
  15. className: 'string',
  16. begin: ' ', end: ' ',
  17. excludeBegin: true, excludeEnd: true
  18. },
  19. {
  20. begin: VERSION
  21. },
  22. {
  23. className: 'keyword',
  24. begin: '[A-Z]+'
  25. }
  26. ]
  27. },
  28. {
  29. className: 'attribute',
  30. begin: '^\\w', end: ': ', excludeEnd: true,
  31. illegal: '\\n|\\s|=',
  32. starts: {end: '$', relevance: 0}
  33. },
  34. {
  35. begin: '\\n\\n',
  36. starts: {subLanguage: [], endsWithParent: true}
  37. }
  38. ]
  39. };
  40. };