Skip to content

Commit acb86be

Browse files
save file
1 parent 61e7792 commit acb86be

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

‎utils/editors/html/code-explorer/v1.0/code-explorer-v1.0.html‎

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,11 @@
547547
*/
548548
var match = tag.match(/^<\s*\/?\s*([a-z0-9\-]+)/i);
549549
var name = match ? match[1].toLowerCase() : '';
550+
console.log(name);
550551
if(!name)debugger;
552+
var attrs = {};
551553

552-
if(name){
554+
if(name && !name.startsWith('</')){
553555
var parser = new DOMParser();
554556
var doc = parser.parseFromString(tag,'text/html');
555557
var element = doc.querySelector(name);
@@ -563,19 +565,20 @@
563565
}//for
564566

565567
//console.log(name,attributes);
566-
var line = lineno(txt,index);
567-
var indent = parse.indent(txt,index);
568-
569-
var o = {
570-
index,
571-
line,
572-
indent,
573-
name,
574-
attrs
575-
};
576-
list.push(o);
577568
}
578569

570+
var line = lineno(txt,index);
571+
var indent = parse.indent(txt,index);
572+
573+
var o = {
574+
index,
575+
line,
576+
indent,
577+
name,
578+
attrs
579+
};
580+
list.push(o);
581+
579582

580583
//console.log(`Found "${tagName}" at index ${index}`);
581584

0 commit comments

Comments
 (0)