(name, isclose)
| 298 | |
| 299 | // tokenizer for XML tags |
| 300 | function tokenTag(name, isclose) { |
| 301 | return function(stream, state) { |
| 302 | stream.eatSpace(); |
| 303 | if(isclose && stream.eat(">")) { |
| 304 | popStateStack(state); |
| 305 | state.tokenize = tokenBase; |
| 306 | return ret("tag", "tag"); |
| 307 | } |
| 308 | // self closing tag without attributes? |
| 309 | if(!stream.eat("/")) |
| 310 | pushStateStack(state, { type: "tag", name: name, tokenize: tokenBase}); |
| 311 | if(!stream.eat(">")) { |
| 312 | state.tokenize = tokenAttribute; |
| 313 | return ret("tag", "tag"); |
| 314 | } |
| 315 | else { |
| 316 | state.tokenize = tokenBase; |
| 317 | } |
| 318 | return ret("tag", "tag"); |
| 319 | }; |
| 320 | } |
| 321 | |
| 322 | // tokenizer for XML attributes |
| 323 | function tokenAttribute(stream, state) { |
no test coverage detected