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 {
687
687
}
688
688
const attrs = { } as RawAttributes ;
689
689
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;
691
691
let match : RegExpExecArray ;
692
692
while ( ( match = re . exec ( this . rawAttrs ) ) ) {
693
693
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 1
1
const { parse } = require ( '@test/test-target' ) ;
2
2
3
- // https://github.com/taoqf/node-html-parser/issues/206
3
+ // https://github.com/taoqf/node-html-parser/pull/207
4
4
describe ( 'void tags' , function ( ) {
5
5
it ( 'default' , function ( ) {
6
6
const root = parse ( '<div><br></div>' ) ;
You can’t perform that action at this time.
0 commit comments