CommWEB/obj/Release/Package/PackageTmp/inc/xheditor/xheditor_plugins/htmldomparser.js

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*
 * HTMLParser - This implementation of parser assumes we are parsing HTML in browser
 * and user DOM methods available in browser for parsing HTML.
 * 
 * @author Himanshu Gilani
 * 
 */

var HTMLParser = function(node, handler, opts) {
	opts = opts || {};
	var nodesToIgnore = opts['nodesToIgnore'] || [];
	var parseHiddenNodes = opts['parseHiddenNodes'] || 'false';
	
	var c = node.childNodes;
	for ( var i = 0; i < c.length; i++) {
		try {
			var ignore = false;
			for(var k=0; k< nodesToIgnore.length; k++) {
				if(c[i].nodeName.toLowerCase() == nodesToIgnore[k]) {
					ignore= true;
					break;
				}
			}
			
			//NOTE hidden node testing is expensive in FF.
			if (ignore || (!parseHiddenNodes && isHiddenNode(c[i]))  ){
				continue;
			} 
			
			if (c[i].nodeName.toLowerCase() != "#text" && c[i].nodeName.toLowerCase() != "#comment") {
				var attrs = [];

				if (c[i].hasAttributes()) {
					var attributes = c[i].attributes;
					for ( var a = 0; a < attributes.length; a++) {
						var attribute = attributes.item(a);

						attrs.push({
							name : attribute.nodeName,
							value : attribute.nodeValue,
						});
					}
				}

				if (handler.start) {
					if (c[i].hasChildNodes()) {
						handler.start(c[i].nodeName, attrs, false);

						if (c[i].nodeName.toLowerCase() == "pre" || c[i].nodeName.toLowerCase() == "code") {
							handler.chars(c[i].innerHTML);
						} else if (c[i].nodeName.toLowerCase() == "iframe" || c[i].nodeName.toLowerCase() == "frame") {
							if (c[i].contentDocument && c[i].contentDocument.documentElement) {
								return HTMLParser(c[i].contentDocument.documentElement, handler, opts);
							}
						} else if (c[i].hasChildNodes()) {
							HTMLParser(c[i], handler, opts);
						}

						if (handler.end) {
							handler.end(c[i].nodeName);
后面还有 38 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。