docs: function findOccurrences(ast, ctxt) {
  		if(ast && ctxt) {
  			var start = ctxt.selection.start;
  			var end = ctxt.selection.end;
  			var source = ast.source;
  			
  			// If caret is beside a tag, mark it rather than the parent
  			if (start === end){
  				if ('<' === source[start]){
  					start++;
  					end++;
  				} else if ('>' === source[start-1]){
  					start--;
  					end--;
  				}
  			}
  			var node = util.findNodeAtOffset(ast, start);
  			if(node) {
  				var occurrences = [];
  				if (node.type === 'attr'){
  					var p = node.parent;
  					if(p && Array.isArray(p.attributes)) {
  						occurrences.push({start: node.range[0], end: node.range[0]+node.name.length, type: node.type});
  						p.attributes.forEach(function(attr) {
  							if(attr.name === node.name && node.range[0] !== attr.range[0]) {
  								occurrences.push({start: attr.range[0], end: attr.range[0]+attr.name.length, type: node.type});
  							}
  						});
  					}
  					return occurrences;
  				} else if(node.type === 'text') {
  					node = node.parent ? node.parent : node;
  				}
  				if (node.type === 'tag'){
  					var tagName = node.name;
  					var openTagStart = node.range[0];
  					openTagStart++; // after the open bracket <
  					var openTagEnd = openTagStart+tagName.length;
  					var closeTagEnd = node.range[1] - 1;
  					var closeTagStart = closeTagEnd;
  					
  					// Since the parser does not handle incorrect HTML well, we do some sanity checking here
  					if(tagName !== source.substring(openTagStart, openTagEnd)){
  						return []; // Unexpected open tag, abort
  					}
  					
  					var char = source[closeTagStart];
  					var selfClose = false;
  					if (char === '>'){
  						closeTagStart--;
  						// Check for inline tag format <body/>
  						selfClose = '/' === source[closeTagStart];
  						if (!selfClose){
  							closeTagStart -= tagName.length;
  							if ('/' + tagName !== source.substring(closeTagStart,closeTagEnd)){
  								if (node.openrange && !node.endrange){
  									// Void tag or some element with only an opening tag, only mark the open tag
  									closeTagStart = closeTagEnd = -1;
  								} else {
  									return []; // Unexpected end tag, abort
  								}
  							}
  						}
  					} else {
  						return []; // Unexpected character, abort
  					}
  					if (start >= node.range[0] && end <= node.range[1]){
  						occurrences.push({start: openTagStart, end: openTagEnd, type: node.type});
  						if (closeTagStart >= 0){
  							occurrences.push({start: closeTagStart, end: closeTagEnd, closeTag: true, selfClose: selfClose, type: node.type});
  						}
  					}
  					return occurrences;
  				}
  			}
  		}
  		return [];
  	}