73bcce88
luigser
COMPONENTS
|
1
2
3
4
|
Prism.languages.markdown = Prism.languages.extend('markup', {});
Prism.languages.insertBefore('markdown', 'prolog', {
'blockquote': {
// > ...
|
eb240478
Luigi Serra
public room cards...
|
5
|
pattern: /^>(?:[\t ]*>)*/m,
|
73bcce88
luigser
COMPONENTS
|
6
7
8
9
10
|
alias: 'punctuation'
},
'code': [
{
// Prefixed by 4 spaces or 1 tab
|
eb240478
Luigi Serra
public room cards...
|
11
|
pattern: /^(?: {4}|\t).+/m,
|
73bcce88
luigser
COMPONENTS
|
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
alias: 'keyword'
},
{
// `code`
// ``code``
pattern: /``.+?``|`[^`\n]+`/,
alias: 'keyword'
}
],
'title': [
{
// title 1
// =======
// title 2
// -------
|
eb240478
Luigi Serra
public room cards...
|
28
|
pattern: /\w+.*(?:\r?\n|\r)(?:==+|--+)/,
|
73bcce88
luigser
COMPONENTS
|
29
30
31
32
33
34
35
36
|
alias: 'important',
inside: {
punctuation: /==+$|--+$/
}
},
{
// # title 1
// ###### title 6
|
eb240478
Luigi Serra
public room cards...
|
37
|
pattern: /(^\s*)#+.+/m,
|
73bcce88
luigser
COMPONENTS
|
38
39
40
41
42
43
44
45
46
47
48
49
|
lookbehind: true,
alias: 'important',
inside: {
punctuation: /^#+|#+$/
}
}
],
'hr': {
// ***
// ---
// * * *
// -----------
|
eb240478
Luigi Serra
public room cards...
|
50
|
pattern: /(^\s*)([*-])([\t ]*\2){2,}(?=\s*$)/m,
|
73bcce88
luigser
COMPONENTS
|
51
52
53
54
55
56
57
58
|
lookbehind: true,
alias: 'punctuation'
},
'list': {
// * item
// + item
// - item
// 1. item
|
eb240478
Luigi Serra
public room cards...
|
59
|
pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,
|
73bcce88
luigser
COMPONENTS
|
60
61
62
63
64
65
66
67
|
lookbehind: true,
alias: 'punctuation'
},
'url-reference': {
// [id]: http://example.com "Optional title"
// [id]: http://example.com 'Optional title'
// [id]: http://example.com (Optional title)
// [id]: <http://example.com> "Optional title"
|
eb240478
Luigi Serra
public room cards...
|
68
|
pattern: /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,
|
73bcce88
luigser
COMPONENTS
|
69
70
71
72
73
|
inside: {
'variable': {
pattern: /^(!?\[)[^\]]+/,
lookbehind: true
},
|
eb240478
Luigi Serra
public room cards...
|
74
75
|
'string': /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,
'punctuation': /^[\[\]!:]|[<>]/
|
73bcce88
luigser
COMPONENTS
|
76
77
78
79
80
81
82
83
|
},
alias: 'url'
},
'bold': {
// **strong**
// __strong__
// Allow only one line break
|
eb240478
Luigi Serra
public room cards...
|
84
|
pattern: /(^|[^\\])(\*\*|__)(?:(?:\r?\n|\r)(?!\r?\n|\r)|.)+?\2/,
|
73bcce88
luigser
COMPONENTS
|
85
86
|
lookbehind: true,
inside: {
|
eb240478
Luigi Serra
public room cards...
|
87
|
'punctuation': /^\*\*|^__|\*\*$|__$/
|
73bcce88
luigser
COMPONENTS
|
88
89
90
91
92
93
94
|
}
},
'italic': {
// *em*
// _em_
// Allow only one line break
|
eb240478
Luigi Serra
public room cards...
|
95
|
pattern: /(^|[^\\])([*_])(?:(?:\r?\n|\r)(?!\r?\n|\r)|.)+?\2/,
|
73bcce88
luigser
COMPONENTS
|
96
97
98
99
100
101
102
103
|
lookbehind: true,
inside: {
'punctuation': /^[*_]|[*_]$/
}
},
'url': {
// [example](http://example.com "Optional title")
// [example] [id]
|
eb240478
Luigi Serra
public room cards...
|
104
|
pattern: /!?\[[^\]]+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)| ?\[[^\]\n]*\])/,
|
73bcce88
luigser
COMPONENTS
|
105
106
107
108
109
110
|
inside: {
'variable': {
pattern: /(!?\[)[^\]]+(?=\]$)/,
lookbehind: true
},
'string': {
|
eb240478
Luigi Serra
public room cards...
|
111
|
pattern: /"(?:\\.|[^"\\])*"(?=\)$)/
|
73bcce88
luigser
COMPONENTS
|
112
113
114
115
116
117
118
119
120
|
}
}
}
});
Prism.languages.markdown['bold'].inside['url'] = Prism.util.clone(Prism.languages.markdown['url']);
Prism.languages.markdown['italic'].inside['url'] = Prism.util.clone(Prism.languages.markdown['url']);
Prism.languages.markdown['bold'].inside['italic'] = Prism.util.clone(Prism.languages.markdown['italic']);
Prism.languages.markdown['italic'].inside['bold'] = Prism.util.clone(Prism.languages.markdown['bold']);
|