prism-editorconfig.js 537 B

12345678910111213141516171819202122232425
  1. Prism.languages.editorconfig = {
  2. // https://editorconfig-specification.readthedocs.io/en/latest/
  3. 'comment': /[;#].*/,
  4. 'section': {
  5. pattern: /(^[ \t]*)\[.+]/m,
  6. lookbehind: true,
  7. alias: 'keyword',
  8. inside: {
  9. 'regex': /\\\\[\[\]{},!?.*]/, // Escape special characters with '\\'
  10. 'operator': /[!?]|\.\.|\*{1,2}/,
  11. 'punctuation': /[\[\]{},]/
  12. }
  13. },
  14. 'property': {
  15. pattern: /(^[ \t]*)[^\s=]+(?=[ \t]*=)/m,
  16. lookbehind: true
  17. },
  18. 'value': {
  19. pattern: /=.*/,
  20. alias: 'string',
  21. inside: {
  22. 'punctuation': /^=/
  23. }
  24. }
  25. };