File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -687,7 +687,7 @@ export default class HTMLElement extends Node {
687687 }
688688 const attrs = { } as RawAttributes ;
689689 if ( this . rawAttrs ) {
690- const re = / ( [ a - z A - Z ( ) # ] [ a - z A - Z 0 - 9 - _ : ( ) # ] * ) (?: \s * = \s * ( (?: ' [ ^ ' ] * ' ) | (?: " [ ^ " ] * " ) | \S + ) ) ? / g;
690+ const re = / ( [ a - z A - Z ( ) [ \] # ] [ a - z A - Z 0 - 9 - _ : ( ) [ \] # ] * ) (?: \s * = \s * ( (?: ' [ ^ ' ] * ' ) | (?: " [ ^ " ] * " ) | \S + ) ) ? / g;
691691 let match : RegExpExecArray ;
692692 while ( ( match = re . exec ( this . rawAttrs ) ) ) {
693693 const key = match [ 1 ] ;
Original file line number Diff line number Diff line change 1+ const { parse } = require ( '@test/test-target' ) ;
2+
3+ // https://github.com/taoqf/node-html-parser/issues/186
4+ describe ( 'angular template' , function ( ) {
5+ it ( 'attribute name contains []' , function ( ) {
6+ const root = parse ( '<input [(ngModel)]="foo">' ) ;
7+ const input = root . firstChild ;
8+ 'foo' . should . eql ( input . getAttribute ( '[(ngModel)]' ) ) ;
9+ root . toString ( ) . should . eql ( '<input [(ngModel)]="foo">' ) ;
10+ } ) ;
11+ } ) ;
Original file line number Diff line number Diff line change 11const { parse } = require ( '@test/test-target' ) ;
22
3- // https://github.com/taoqf/node-html-parser/issues/206
3+ // https://github.com/taoqf/node-html-parser/pull/207
44describe ( 'void tags' , function ( ) {
55 it ( 'default' , function ( ) {
66 const root = parse ( '<div><br></div>' ) ;
You can’t perform that action at this time.
0 commit comments