File tree 6 files changed +123
-183
lines changed
6 files changed +123
-183
lines changed Original file line number Diff line number Diff line change 221
221
// [example](http://example.com "Optional title")
222
222
// [example][id]
223
223
// [example] [id]
224
- pattern : createInline ( / ! ? \[ (?: (? ! \] ) < i n n e r > ) + \] (?: \( [ ^ \s ) ] + (?: [ \t ] + " (?: \\ .| [ ^ " \\ ] ) * " ) ? \) | ? \[ (?: (? ! \] ) < i n n e r > ) + \] ) / . source ) ,
224
+ pattern : createInline ( / ! ? \[ (?: (? ! \] ) < i n n e r > ) + \] (?: \( [ ^ \s ) ] + (?: [ \t ] + " (?: \\ .| [ ^ " \\ ] ) * " ) ? \) | [ \t ] ? \[ (?: (? ! \] ) < i n n e r > ) + \] ) / . source ) ,
225
225
lookbehind : true ,
226
226
greedy : true ,
227
227
inside : {
228
- 'variable' : {
229
- pattern : / ( \[ ) [ ^ \] ] + (? = \] $ ) / ,
230
- lookbehind : true
231
- } ,
228
+ 'operator' : / ^ ! / ,
232
229
'content' : {
233
- pattern : / ( ^ ! ? \[ ) [ ^ \] ] + (? = \] ) / ,
230
+ pattern : / ( ^ \[ ) [ ^ \] ] + (? = \] ) / ,
234
231
lookbehind : true ,
235
232
inside : { } // see below
236
233
} ,
234
+ 'variable' : {
235
+ pattern : / ( ^ \] [ \t ] ? \[ ) [ ^ \] ] + (? = \] $ ) / ,
236
+ lookbehind : true
237
+ } ,
238
+ 'url' : {
239
+ pattern : / ( ^ \] \( ) [ ^ \s ) ] + / ,
240
+ lookbehind : true
241
+ } ,
237
242
'string' : {
238
- pattern : / " (?: \\ .| [ ^ " \\ ] ) * " (? = \) $ ) /
243
+ pattern : / ( ^ [ \t ] + ) " (?: \\ .| [ ^ " \\ ] ) * " (? = \) $ ) / ,
244
+ lookbehind : true
239
245
}
240
246
}
241
247
}
Original file line number Diff line number Diff line change @@ -24,41 +24,32 @@ not__bold__ __this__either
24
24
[
25
25
["bold", [
26
26
["punctuation", "**"],
27
- ["content", [
28
- "foobar"
29
- ]],
27
+ ["content", ["foobar"]],
30
28
["punctuation", "**"]
31
29
]],
32
30
["bold", [
33
31
["punctuation", "**"],
34
- ["content", [
35
- "foo\r\nbar"
36
- ]],
32
+ ["content", ["foo\r\nbar"]],
37
33
["punctuation", "**"]
38
34
]],
39
35
["bold", [
40
36
["punctuation", "__"],
41
- ["content", [
42
- "foobar"
43
- ]],
37
+ ["content", ["foobar"]],
44
38
["punctuation", "__"]
45
39
]],
46
40
["bold", [
47
41
["punctuation", "__"],
48
- ["content", [
49
- "foo\r\nbar"
50
- ]],
42
+ ["content", ["foo\r\nbar"]],
51
43
["punctuation", "__"]
52
44
]],
45
+
53
46
["bold", [
54
47
["punctuation", "__"],
55
48
["content", [
56
49
"foo ",
57
50
["italic", [
58
51
["punctuation", "*"],
59
- ["content", [
60
- "bar"
61
- ]],
52
+ ["content", ["bar"]],
62
53
["punctuation", "*"]
63
54
]],
64
55
" baz"
@@ -71,9 +62,7 @@ not__bold__ __this__either
71
62
"foo ",
72
63
["italic", [
73
64
["punctuation", "_"],
74
- ["content", [
75
- "bar"
76
- ]],
65
+ ["content", ["bar"]],
77
66
["punctuation", "_"]
78
67
]],
79
68
" baz"
@@ -86,9 +75,7 @@ not__bold__ __this__either
86
75
"foo ",
87
76
["strike", [
88
77
["punctuation", "~"],
89
- ["content", [
90
- "bar"
91
- ]],
78
+ ["content", ["bar"]],
92
79
["punctuation", "~"]
93
80
]],
94
81
" baz"
@@ -101,9 +88,7 @@ not__bold__ __this__either
101
88
"foo ",
102
89
["strike", [
103
90
["punctuation", "~~"],
104
- ["content", [
105
- "bar"
106
- ]],
91
+ ["content", ["bar"]],
107
92
["punctuation", "~~"]
108
93
]],
109
94
" baz"
@@ -116,23 +101,22 @@ not__bold__ __this__either
116
101
"foo",
117
102
["url", [
118
103
"[",
119
- ["content", [
120
- "bar"
121
- ] ],
122
- "](baz )"
104
+ ["content", ["bar"]],
105
+ "](",
106
+ ["url", "baz" ],
107
+ ")"
123
108
]]
124
109
]],
125
110
["punctuation", "__"]
126
111
]],
112
+
127
113
["bold", [
128
114
["punctuation", "**"],
129
115
["content", [
130
116
"foo ",
131
117
["italic", [
132
118
["punctuation", "*"],
133
- ["content", [
134
- "bar"
135
- ]],
119
+ ["content", ["bar"]],
136
120
["punctuation", "*"]
137
121
]],
138
122
" baz"
@@ -145,9 +129,7 @@ not__bold__ __this__either
145
129
"foo ",
146
130
["italic", [
147
131
["punctuation", "_"],
148
- ["content", [
149
- "bar"
150
- ]],
132
+ ["content", ["bar"]],
151
133
["punctuation", "_"]
152
134
]],
153
135
" baz"
@@ -160,9 +142,7 @@ not__bold__ __this__either
160
142
"foo ",
161
143
["strike", [
162
144
["punctuation", "~"],
163
- ["content", [
164
- "bar"
165
- ]],
145
+ ["content", ["bar"]],
166
146
["punctuation", "~"]
167
147
]],
168
148
" baz"
@@ -175,9 +155,7 @@ not__bold__ __this__either
175
155
"foo ",
176
156
["strike", [
177
157
["punctuation", "~~"],
178
- ["content", [
179
- "bar"
180
- ]],
158
+ ["content", ["bar"]],
181
159
["punctuation", "~~"]
182
160
]],
183
161
" baz"
@@ -190,14 +168,15 @@ not__bold__ __this__either
190
168
"foo",
191
169
["url", [
192
170
"[",
193
- ["content", [
194
- "bar"
195
- ] ],
196
- "](baz )"
171
+ ["content", ["bar"]],
172
+ "](",
173
+ ["url", "baz" ],
174
+ ")"
197
175
]]
198
176
]],
199
177
["punctuation", "**"]
200
178
]],
179
+
201
180
"\r\n\r\nnot__bold__ __this__either"
202
181
]
203
182
Original file line number Diff line number Diff line change @@ -24,41 +24,32 @@ not_italic_ _this_either
24
24
[
25
25
["italic", [
26
26
["punctuation", "*"],
27
- ["content", [
28
- "foobar"
29
- ]],
27
+ ["content", ["foobar"]],
30
28
["punctuation", "*"]
31
29
]],
32
30
["italic", [
33
31
["punctuation", "*"],
34
- ["content", [
35
- "foo\r\nbar"
36
- ]],
32
+ ["content", ["foo\r\nbar"]],
37
33
["punctuation", "*"]
38
34
]],
39
35
["italic", [
40
36
["punctuation", "_"],
41
- ["content", [
42
- "foobar"
43
- ]],
37
+ ["content", ["foobar"]],
44
38
["punctuation", "_"]
45
39
]],
46
40
["italic", [
47
41
["punctuation", "_"],
48
- ["content", [
49
- "foo\r\nbar"
50
- ]],
42
+ ["content", ["foo\r\nbar"]],
51
43
["punctuation", "_"]
52
44
]],
45
+
53
46
["italic", [
54
47
["punctuation", "_"],
55
48
["content", [
56
49
"foo ",
57
50
["bold", [
58
51
["punctuation", "__"],
59
- ["content", [
60
- "bar"
61
- ]],
52
+ ["content", ["bar"]],
62
53
["punctuation", "__"]
63
54
]],
64
55
" baz"
@@ -71,9 +62,7 @@ not_italic_ _this_either
71
62
"foo ",
72
63
["bold", [
73
64
["punctuation", "**"],
74
- ["content", [
75
- "bar"
76
- ]],
65
+ ["content", ["bar"]],
77
66
["punctuation", "**"]
78
67
]],
79
68
" baz"
@@ -86,9 +75,7 @@ not_italic_ _this_either
86
75
"foo ",
87
76
["strike", [
88
77
["punctuation", "~"],
89
- ["content", [
90
- "bar"
91
- ]],
78
+ ["content", ["bar"]],
92
79
["punctuation", "~"]
93
80
]],
94
81
" baz"
@@ -101,9 +88,7 @@ not_italic_ _this_either
101
88
"foo ",
102
89
["strike", [
103
90
["punctuation", "~~"],
104
- ["content", [
105
- "bar"
106
- ]],
91
+ ["content", ["bar"]],
107
92
["punctuation", "~~"]
108
93
]],
109
94
" baz"
@@ -116,23 +101,22 @@ not_italic_ _this_either
116
101
"foo",
117
102
["url", [
118
103
"[",
119
- ["content", [
120
- "bar"
121
- ] ],
122
- "](baz )"
104
+ ["content", ["bar"]],
105
+ "](",
106
+ ["url", "baz" ],
107
+ ")"
123
108
]]
124
109
]],
125
110
["punctuation", "_"]
126
111
]],
112
+
127
113
["italic", [
128
114
["punctuation", "*"],
129
115
["content", [
130
116
"foo ",
131
117
["bold", [
132
118
["punctuation", "__"],
133
- ["content", [
134
- "bar"
135
- ]],
119
+ ["content", ["bar"]],
136
120
["punctuation", "__"]
137
121
]],
138
122
" baz"
@@ -145,9 +129,7 @@ not_italic_ _this_either
145
129
"foo ",
146
130
["bold", [
147
131
["punctuation", "**"],
148
- ["content", [
149
- "bar"
150
- ]],
132
+ ["content", ["bar"]],
151
133
["punctuation", "**"]
152
134
]],
153
135
" baz"
@@ -160,9 +142,7 @@ not_italic_ _this_either
160
142
"foo ",
161
143
["strike", [
162
144
["punctuation", "~"],
163
- ["content", [
164
- "bar"
165
- ]],
145
+ ["content", ["bar"]],
166
146
["punctuation", "~"]
167
147
]],
168
148
" baz"
@@ -175,9 +155,7 @@ not_italic_ _this_either
175
155
"foo ",
176
156
["strike", [
177
157
["punctuation", "~~"],
178
- ["content", [
179
- "bar"
180
- ]],
158
+ ["content", ["bar"]],
181
159
["punctuation", "~~"]
182
160
]],
183
161
" baz"
@@ -190,14 +168,15 @@ not_italic_ _this_either
190
168
"foo",
191
169
["url", [
192
170
"[",
193
- ["content", [
194
- "bar"
195
- ] ],
196
- "](baz )"
171
+ ["content", ["bar"]],
172
+ "](",
173
+ ["url", "baz" ],
174
+ ")"
197
175
]]
198
176
]],
199
177
["punctuation", "*"]
200
178
]],
179
+
201
180
"\r\n\r\nnot_italic_ _this_either"
202
181
]
203
182
You can’t perform that action at this time.
0 commit comments