UNPKG

929 BJavaScriptView Raw
1Prism.languages.ini = {
2
3 /**
4 * The component mimics the behavior of the Win32 API parser.
5 *
6 * @see {@link https://github.com/PrismJS/prism/issues/2775#issuecomment-787477723}
7 */
8
9 'comment': {
10 pattern: /(^[ \f\t\v]*)[#;][^\n\r]*/m,
11 lookbehind: true
12 },
13 'section': {
14 pattern: /(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,
15 lookbehind: true,
16 inside: {
17 'section-name': {
18 pattern: /(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,
19 lookbehind: true,
20 alias: 'selector'
21 },
22 'punctuation': /\[|\]/
23 }
24 },
25 'key': {
26 pattern: /(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,
27 lookbehind: true,
28 alias: 'attr-name'
29 },
30 'value': {
31 pattern: /(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,
32 lookbehind: true,
33 alias: 'attr-value',
34 inside: {
35 'inner-value': {
36 pattern: /^("|').+(?=\1$)/,
37 lookbehind: true
38 }
39 }
40 },
41 'punctuation': /=/
42};