prism-dns-zone-file.js 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. Prism.languages['dns-zone-file'] = {
  2. 'comment': /;.*/,
  3. 'string': {
  4. pattern: /"(?:\\.|[^"\\\r\n])*"/,
  5. greedy: true
  6. },
  7. 'variable': [
  8. {
  9. pattern: /(^\$ORIGIN[ \t]+)\S+/m,
  10. lookbehind: true,
  11. },
  12. {
  13. pattern: /(^|\s)@(?=\s|$)/,
  14. lookbehind: true,
  15. }
  16. ],
  17. 'keyword': /^\$(?:INCLUDE|ORIGIN|TTL)(?=\s|$)/m,
  18. 'class': {
  19. // https://tools.ietf.org/html/rfc1035#page-13
  20. pattern: /(^|\s)(?:CH|CS|HS|IN)(?=\s|$)/,
  21. lookbehind: true,
  22. alias: 'keyword'
  23. },
  24. 'type': {
  25. // https://en.wikipedia.org/wiki/List_of_DNS_record_types
  26. pattern: /(^|\s)(?:A|A6|AAAA|AFSDB|APL|ATMA|CAA|CDNSKEY|CDS|CERT|CNAME|DHCID|DLV|DNAME|DNSKEY|DS|EID|GID|GPOS|HINFO|HIP|IPSECKEY|ISDN|KEY|KX|LOC|MAILA|MAILB|MB|MD|MF|MG|MINFO|MR|MX|NAPTR|NB|NBSTAT|NIMLOC|NINFO|NS|NSAP|NSAP-PTR|NSEC|NSEC3|NSEC3PARAM|NULL|NXT|OPENPGPKEY|PTR|PX|RKEY|RP|RRSIG|RT|SIG|SINK|SMIMEA|SOA|SPF|SRV|SSHFP|TA|TKEY|TLSA|TSIG|TXT|UID|UINFO|UNSPEC|URI|WKS|X25)(?=\s|$)/,
  27. lookbehind: true,
  28. alias: 'keyword'
  29. },
  30. 'punctuation': /[()]/
  31. };
  32. Prism.languages['dns-zone'] = Prism.languages['dns-zone-file'];