X Tutup
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions modules/angular2/src/compiler/html_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ function parseText(text: Text, indexInParent: number, parentSourceInfo: string):
function parseAttr(element: Element, parentSourceInfo: string, attrName: string,
attrValue: string): HtmlAttrAst {
// TODO(tbosch): add source row/column source info from parse5 / package:html
var lowerCaseAttrName = attrName.toLowerCase();
return new HtmlAttrAst(lowerCaseAttrName, attrValue,
`${parentSourceInfo}[${lowerCaseAttrName}=${attrValue}]`);
return new HtmlAttrAst(attrName, attrValue, `${parentSourceInfo}[${attrName}=${attrValue}]`);
}

function parseElement(element: Element, indexInParent: number,
Expand Down
8 changes: 4 additions & 4 deletions modules/angular2/test/compiler/html_parser_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ export function main() {
]);
});

it('should parse and lower case attributes on regular elements', () => {
expect(humanizeDom(parser.parse('<div FoO="bar"></div>', 'TestComp')))
it('should parse attributes on svg elements case sensitive', () => {
expect(humanizeDom(parser.parse('<svg viewBox="0"></svg>', 'TestComp')))
.toEqual([
[HtmlElementAst, 'div', 'TestComp > div:nth-child(0)'],
[HtmlAttrAst, 'foo', 'bar', 'TestComp > div:nth-child(0)[foo=bar]']
[HtmlElementAst, 'svg', 'TestComp > svg:nth-child(0)'],
[HtmlAttrAst, 'viewBox', '0', 'TestComp > svg:nth-child(0)[viewBox=0]']
]);
});

Expand Down
X Tutup