Index: trunk/extensions/ParserPlayground/modules/ext.parserPlayground.serializer.js |
— | — | @@ -81,6 +81,9 @@ |
82 | 82 | } |
83 | 83 | } |
84 | 84 | } |
| 85 | + if ('ws' in tree) { |
| 86 | + src += tree.ws; |
| 87 | + } |
85 | 88 | if ('content' in tree) { |
86 | 89 | src += '>'; |
87 | 90 | src += subParseArray(tree.content); |
Index: trunk/extensions/ParserPlayground/modules/pegParser.pegjs.txt |
— | — | @@ -133,7 +133,7 @@ |
134 | 134 | = c:[^\n]+ { return c.join(''); } |
135 | 135 | |
136 | 136 | extlink |
137 | | - = "[" target:url space text:extlink_text "]" { |
| 137 | + = "[" target:url " " text:extlink_text "]" { |
138 | 138 | return { |
139 | 139 | type: 'extlink', |
140 | 140 | target: target, |
— | — | @@ -240,28 +240,34 @@ |
241 | 241 | ref = ref_full / ref_empty |
242 | 242 | |
243 | 243 | ref_full |
244 | | - = params:ref_start ">" content:ref_content+ close:ref_end { |
| 244 | + = start:ref_start ">" content:ref_content+ close:ref_end { |
245 | 245 | return { |
246 | 246 | type: 'ext', |
247 | 247 | name: 'ref', |
248 | | - params: params, |
| 248 | + params: start.params, |
| 249 | + ws: start.ws, |
249 | 250 | content: content, |
250 | 251 | close: close |
251 | 252 | } |
252 | 253 | } |
253 | 254 | |
254 | 255 | ref_empty |
255 | | - = params:ref_start "/>" { |
| 256 | + = start:ref_start close:(space* "/>") { |
256 | 257 | return { |
257 | 258 | type: 'ext', |
258 | 259 | name: 'ref', |
259 | | - params: params |
| 260 | + ws: start.ws, |
| 261 | + params: start.params, |
| 262 | + close: close |
260 | 263 | } |
261 | 264 | } |
262 | 265 | |
263 | 266 | ref_start |
264 | | - = "<ref" params:ext_param* space* { |
265 | | - return params; |
| 267 | + = "<ref" params:ext_param* ws:space* { |
| 268 | + return { |
| 269 | + params: params, |
| 270 | + ws: ws |
| 271 | + }; |
266 | 272 | } |
267 | 273 | |
268 | 274 | ref_end |