code: function tmplOrMarkupFromStr(value) {
  			// If value is of type string - treat as selector, or name of compiled template
  			// Return the template object, if already compiled, or the markup string
  
  			if (("" + value === value) || value.nodeType > 0) {
  				try {
  					elem = value.nodeType > 0
  					? value
  					: !rTmplString.test(value)
  					// If value is a string and does not contain HTML or tag content, then test as selector
  						&& jQuery && jQuery(global.document).find(value)[0];
  					// If selector is valid and returns at least one element, get first element
  					// If invalid, jQuery will throw. We will stay with the original string.
  				} catch (e) {}
  
  				if (elem) {
  					// Generally this is a script element.
  					// However we allow it to be any element, so you can for example take the content of a div,
  					// use it as a template, and replace it by the same content rendered against data.
  					// e.g. for linking the content of a div to a container, and using the initial content as template:
  					// $.link("#content", model, {tmpl: "#content"});
  
  					value = elem.getAttribute(tmplAttr);
  					name = name || value;
  					value = $templates[value];
  					if (!value) {
  						// Not already compiled and cached, so compile and cache the name
  						// Create a name for compiled template if none provided
  						name = name || "_" + autoTmplName++;
  						elem.setAttribute(tmplAttr, name);
  						value = $templates[name] = compileTmpl(name, elem.innerHTML, parentTmpl, storeName, storeSettings, options); // Use tmpl as options
  					}
  				}
  				return value;
  			}
  			// If value is not a string, return undefined
  		}
docs: tmpl is either a template object, a selector for a template script block, the name of a compiled template, or a template object ==== nested functions ====