MCPcopy Create free account
hub / github.com/TruthHun/BookStack / tokenTag

Function tokenTag

static/editor.md/lib/codemirror/mode/xquery/xquery.js:300–320  ·  view source on GitHub ↗
(name, isclose)

Source from the content-addressed store, hash-verified

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) {

Callers 1

tokenBaseFunction · 0.85

Calls 3

popStateStackFunction · 0.85
pushStateStackFunction · 0.85
retFunction · 0.70

Tested by

no test coverage detected