OLD | NEW |
1 Prism.languages.wiki = Prism.languages.extend('markup', { | 1 Prism.languages.wiki = Prism.languages.extend('markup', { |
2 'block-comment': { | 2 'block-comment': { |
3 pattern: /(^|[^\\])\/\*[\w\W]*?\*\//, | 3 pattern: /(^|[^\\])\/\*[\w\W]*?\*\//, |
4 lookbehind: true, | 4 lookbehind: true, |
5 alias: 'comment' | 5 alias: 'comment' |
6 }, | 6 }, |
7 'heading': { | 7 'heading': { |
8 pattern: /^(=+).+?\1/m, | 8 pattern: /^(=+).+?\1/m, |
9 inside: { | 9 inside: { |
10 'punctuation': /^=+|=+$/, | 10 'punctuation': /^=+|=+$/, |
11 'important': /.+/ | 11 'important': /.+/ |
12 } | 12 } |
13 }, | 13 }, |
14 'emphasis': { | 14 'emphasis': { |
15 » » pattern: /('{2,4}).+?\1/, | 15 » » // TODO Multi-line |
| 16 » » pattern: /('{2,5}).+?\1/, |
16 inside: { | 17 inside: { |
17 'bold italic': { | 18 'bold italic': { |
18 » » » » pattern: /('''').+?(?=\1)/, | 19 » » » » pattern: /(''''').+?(?=\1)/, |
19 lookbehind: true | 20 lookbehind: true |
20 }, | 21 }, |
21 'bold': { | 22 'bold': { |
22 » » » » pattern: /(''').+?(?=\1)/, | 23 » » » » pattern: /(''')[^'](?:.*?[^'])?(?=\1)/, |
23 lookbehind: true | 24 lookbehind: true |
24 }, | 25 }, |
25 'italic': { | 26 'italic': { |
26 » » » » pattern: /('').+?(?=\1)/, | 27 » » » » pattern: /('')[^'](?:.*?[^'])?(?=\1)/, |
27 lookbehind: true | 28 lookbehind: true |
28 }, | 29 }, |
29 'punctuation': /^''+|''+$/ | 30 'punctuation': /^''+|''+$/ |
30 } | 31 } |
31 }, | 32 }, |
32 'hr': { | 33 'hr': { |
33 pattern: /^-{4,}/m, | 34 pattern: /^-{4,}/m, |
34 alias: 'punctuation' | 35 alias: 'punctuation' |
35 }, | 36 }, |
36 'url': [ | 37 'url': [ |
37 » » /ISBN +(?:97[89][ -]?)?(?:\d[ -]?){9}[\dx]\b/i, | 38 » » /ISBN +(?:97[89][ -]?)?(?:\d[ -]?){9}[\dx]\b|(?:RFC|PMID) +\d+/i
, |
38 » » /(?:RFC|PMID) +\d+/, | 39 » » /\[\[.+?\]\]|\[.+?\]/ |
39 » » /\[\[.+?\]\]/, | |
40 » » /\[.+?\]/ | |
41 ], | 40 ], |
42 'variable': [ | 41 'variable': [ |
43 /__[A-Z]+__/, | 42 /__[A-Z]+__/, |
| 43 // FIXME Nested structures should be handled |
| 44 // {{formatnum:{{#expr:{{{3}}}}}}} |
44 /\{{3}.+?\}{3}/, | 45 /\{{3}.+?\}{3}/, |
45 /\{\{.+?}}/ | 46 /\{\{.+?}}/ |
46 ], | 47 ], |
47 'symbol': [ | 48 'symbol': [ |
48 /^#redirect/im, | 49 /^#redirect/im, |
49 /~{3,5}/ | 50 /~{3,5}/ |
50 ], | 51 ], |
51 // Handle table attrs: | 52 // Handle table attrs: |
52 // {| | 53 // {| |
53 // ! style="text-align:left;"| Item | 54 // ! style="text-align:left;"| Item |
(...skipping 17 matching lines...) Expand all Loading... |
71 'nowiki': { | 72 'nowiki': { |
72 pattern: /<(nowiki|pre|source)\b[\w\W]*?>[\w\W]*?<\/\1>/i, | 73 pattern: /<(nowiki|pre|source)\b[\w\W]*?>[\w\W]*?<\/\1>/i, |
73 inside: { | 74 inside: { |
74 'tag': { | 75 'tag': { |
75 pattern: /<(?:nowiki|pre|source)\b[\w\W]*?>|<\/(
?:nowiki|pre|source)>/i, | 76 pattern: /<(?:nowiki|pre|source)\b[\w\W]*?>|<\/(
?:nowiki|pre|source)>/i, |
76 inside: Prism.languages.markup['tag'].inside | 77 inside: Prism.languages.markup['tag'].inside |
77 } | 78 } |
78 } | 79 } |
79 } | 80 } |
80 }); | 81 }); |
OLD | NEW |