diff.js 890 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. module.exports = function(hljs) {
  2. return {
  3. aliases: ['patch'],
  4. contains: [
  5. {
  6. className: 'meta',
  7. relevance: 10,
  8. variants: [
  9. {begin: /^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/},
  10. {begin: /^\*\*\* +\d+,\d+ +\*\*\*\*$/},
  11. {begin: /^\-\-\- +\d+,\d+ +\-\-\-\-$/}
  12. ]
  13. },
  14. {
  15. className: 'comment',
  16. variants: [
  17. {begin: /Index: /, end: /$/},
  18. {begin: /={3,}/, end: /$/},
  19. {begin: /^\-{3}/, end: /$/},
  20. {begin: /^\*{3} /, end: /$/},
  21. {begin: /^\+{3}/, end: /$/},
  22. {begin: /^\*{15}$/ }
  23. ]
  24. },
  25. {
  26. className: 'addition',
  27. begin: '^\\+', end: '$'
  28. },
  29. {
  30. className: 'deletion',
  31. begin: '^\\-', end: '$'
  32. },
  33. {
  34. className: 'addition',
  35. begin: '^\\!', end: '$'
  36. }
  37. ]
  38. };
  39. };