{"action":"created","comment":{"url":"https://api.github.com/repos/Polymer/lit-html/pulls/comments/235187469","pull_request_review_id":176997349,"id":235187469,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTE4NzQ2OQ==","diff_hunk":"@@ -39,32 +39,29 @@ export class TemplateResult {\n    * Returns a string of HTML used to create a `<template>` element.\n    */\n   getHTML(): string {\n-    const l = this.strings.length - 1;\n-    let html = '';\n-    let isTextBinding = true;\n-    for (let i = 0; i < l; i++) {\n-      const s = this.strings[i];\n-      html += s;\n-      const close = s.lastIndexOf('>');\n-      // We're in a text position if the previous string closed its last tag, an\n-      // attribute position if the string opened an unclosed tag, and unchanged\n-      // if the string had no brackets at all:\n-      //\n-      // \"...>...\": text position. open === -1, close > -1\n-      // \"...<...\": attribute position. open > -1\n-      // \"...\": no change. open === -1, close === -1\n-      isTextBinding =\n-          (close > -1 || isTextBinding) && s.indexOf('<', close + 1) === -1;\n-\n-      if (!isTextBinding && rewritesStyleAttribute) {\n-        html = html.replace(lastAttributeNameRegex, (match, p1, p2, p3) => {\n-          return (p2 === 'style') ? `${p1}style$${p3}` : match;\n-        });\n+    const endIndex = this.strings.length - 1;\n+    return this.strings.reduce((acc, s, i) => {\n+      if (i === endIndex) {\n+        return acc + s;\n+      }\n+      // Append a suffix to all bound attribute names to opt out of special\n+      // attribute value parsing that IE11 and Edge do, like for style and\n+      // many SVG attributes.\n+      // The Template class also appends the same suffix when looking up\n+      // attributes to creat Parts.\n+      let addedMarker = false;\n+      acc += s.replace(lastAttributeNameRegex, (match, p1, p2, p3) => {","path":"src/lib/template-result.ts","position":45,"original_position":45,"commit_id":"fd9704518068d4e1d3028a895366f201c3fa507a","original_commit_id":"fd9704518068d4e1d3028a895366f201c3fa507a","user":{"login":"justinfagnani","id":522948,"node_id":"MDQ6VXNlcjUyMjk0OA==","avatar_url":"https://avatars0.githubusercontent.com/u/522948?v=4","gravatar_id":"","url":"https://api.github.com/users/justinfagnani","html_url":"https://github.com/justinfagnani","followers_url":"https://api.github.com/users/justinfagnani/followers","following_url":"https://api.github.com/users/justinfagnani/following{/other_user}","gists_url":"https://api.github.com/users/justinfagnani/gists{/gist_id}","starred_url":"https://api.github.com/users/justinfagnani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinfagnani/subscriptions","organizations_url":"https://api.github.com/users/justinfagnani/orgs","repos_url":"https://api.github.com/users/justinfagnani/repos","events_url":"https://api.github.com/users/justinfagnani/events{/privacy}","received_events_url":"https://api.github.com/users/justinfagnani/received_events","type":"User","site_admin":false},"body":"I named the groups, which helps readability. The docs on the regex itself should suffice for the rest.\r\n\r\nAgreed on the perf note.","created_at":"2018-11-20T22:08:54Z","updated_at":"2018-11-20T22:08:55Z","html_url":"https://github.com/Polymer/lit-html/pull/640#discussion_r235187469","pull_request_url":"https://api.github.com/repos/Polymer/lit-html/pulls/640","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Polymer/lit-html/pulls/comments/235187469"},"html":{"href":"https://github.com/Polymer/lit-html/pull/640#discussion_r235187469"},"pull_request":{"href":"https://api.github.com/repos/Polymer/lit-html/pulls/640"}},"in_reply_to_id":234823713},"pull_request":{"url":"https://api.github.com/repos/Polymer/lit-html/pulls/640","id":232125757,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyMTI1NzU3","html_url":"https://github.com/Polymer/lit-html/pull/640","diff_url":"https://github.com/Polymer/lit-html/pull/640.diff","patch_url":"https://github.com/Polymer/lit-html/pull/640.patch","issue_url":"https://api.github.com/repos/Polymer/lit-html/issues/640","number":640,"state":"open","locked":false,"title":"Rewrite attribute handling to always avoid IE/Edge value parsing and rewriting","user":{"login":"justinfagnani","id":522948,"node_id":"MDQ6VXNlcjUyMjk0OA==","avatar_url":"https://avatars0.githubusercontent.com/u/522948?v=4","gravatar_id":"","url":"https://api.github.com/users/justinfagnani","html_url":"https://github.com/justinfagnani","followers_url":"https://api.github.com/users/justinfagnani/followers","following_url":"https://api.github.com/users/justinfagnani/following{/other_user}","gists_url":"https://api.github.com/users/justinfagnani/gists{/gist_id}","starred_url":"https://api.github.com/users/justinfagnani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinfagnani/subscriptions","organizations_url":"https://api.github.com/users/justinfagnani/orgs","repos_url":"https://api.github.com/users/justinfagnani/repos","events_url":"https://api.github.com/users/justinfagnani/events{/privacy}","received_events_url":"https://api.github.com/users/justinfagnani/received_events","type":"User","site_admin":false},"body":"Fixes #594\r\n\r\nThis changes attribute handling pretty significantly. First, it always rewrites attributes now. We could add back the conditional to only rewrite on Edge. Second, it removes the `isTextBinding` check, and instead relies on the `lastAttributeNameRegex` check to tell us if an expression is in a text position. I was a bit worried about this regex matching for non-attribute cases, but not of the tests fail. I'll try to come up with some more cases to make sure.\r\n\r\n@frankiefu, @keanulee, and @azakus it'd be awesome to try this branch with more real-world templates like we have in PWASK and MWC, if you have a chance to do that.","created_at":"2018-11-19T22:01:37Z","updated_at":"2018-11-20T22:08:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9cdfeed399e7131623dc18fbf7e64c7bbb5d68b1","assignee":null,"assignees":[],"requested_reviewers":[{"login":"sorvell","id":78891,"node_id":"MDQ6VXNlcjc4ODkx","avatar_url":"https://avatars1.githubusercontent.com/u/78891?v=4","gravatar_id":"","url":"https://api.github.com/users/sorvell","html_url":"https://github.com/sorvell","followers_url":"https://api.github.com/users/sorvell/followers","following_url":"https://api.github.com/users/sorvell/following{/other_user}","gists_url":"https://api.github.com/users/sorvell/gists{/gist_id}","starred_url":"https://api.github.com/users/sorvell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sorvell/subscriptions","organizations_url":"https://api.github.com/users/sorvell/orgs","repos_url":"https://api.github.com/users/sorvell/repos","events_url":"https://api.github.com/users/sorvell/events{/privacy}","received_events_url":"https://api.github.com/users/sorvell/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Polymer/lit-html/pulls/640/commits","review_comments_url":"https://api.github.com/repos/Polymer/lit-html/pulls/640/comments","review_comment_url":"https://api.github.com/repos/Polymer/lit-html/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Polymer/lit-html/issues/640/comments","statuses_url":"https://api.github.com/repos/Polymer/lit-html/statuses/fd9704518068d4e1d3028a895366f201c3fa507a","head":{"label":"Polymer:svg","ref":"svg","sha":"fd9704518068d4e1d3028a895366f201c3fa507a","user":{"login":"Polymer","id":2159051,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxNTkwNTE=","avatar_url":"https://avatars3.githubusercontent.com/u/2159051?v=4","gravatar_id":"","url":"https://api.github.com/users/Polymer","html_url":"https://github.com/Polymer","followers_url":"https://api.github.com/users/Polymer/followers","following_url":"https://api.github.com/users/Polymer/following{/other_user}","gists_url":"https://api.github.com/users/Polymer/gists{/gist_id}","starred_url":"https://api.github.com/users/Polymer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polymer/subscriptions","organizations_url":"https://api.github.com/users/Polymer/orgs","repos_url":"https://api.github.com/users/Polymer/repos","events_url":"https://api.github.com/users/Polymer/events{/privacy}","received_events_url":"https://api.github.com/users/Polymer/received_events","type":"Organization","site_admin":false},"repo":{"id":95797174,"node_id":"MDEwOlJlcG9zaXRvcnk5NTc5NzE3NA==","name":"lit-html","full_name":"Polymer/lit-html","private":false,"owner":{"login":"Polymer","id":2159051,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxNTkwNTE=","avatar_url":"https://avatars3.githubusercontent.com/u/2159051?v=4","gravatar_id":"","url":"https://api.github.com/users/Polymer","html_url":"https://github.com/Polymer","followers_url":"https://api.github.com/users/Polymer/followers","following_url":"https://api.github.com/users/Polymer/following{/other_user}","gists_url":"https://api.github.com/users/Polymer/gists{/gist_id}","starred_url":"https://api.github.com/users/Polymer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polymer/subscriptions","organizations_url":"https://api.github.com/users/Polymer/orgs","repos_url":"https://api.github.com/users/Polymer/repos","events_url":"https://api.github.com/users/Polymer/events{/privacy}","received_events_url":"https://api.github.com/users/Polymer/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Polymer/lit-html","description":"An efficient, expressive, extensible HTML templating library for JavaScript.","fork":false,"url":"https://api.github.com/repos/Polymer/lit-html","forks_url":"https://api.github.com/repos/Polymer/lit-html/forks","keys_url":"https://api.github.com/repos/Polymer/lit-html/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Polymer/lit-html/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Polymer/lit-html/teams","hooks_url":"https://api.github.com/repos/Polymer/lit-html/hooks","issue_events_url":"https://api.github.com/repos/Polymer/lit-html/issues/events{/number}","events_url":"https://api.github.com/repos/Polymer/lit-html/events","assignees_url":"https://api.github.com/repos/Polymer/lit-html/assignees{/user}","branches_url":"https://api.github.com/repos/Polymer/lit-html/branches{/branch}","tags_url":"https://api.github.com/repos/Polymer/lit-html/tags","blobs_url":"https://api.github.com/repos/Polymer/lit-html/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Polymer/lit-html/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Polymer/lit-html/git/refs{/sha}","trees_url":"https://api.github.com/repos/Polymer/lit-html/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Polymer/lit-html/statuses/{sha}","languages_url":"https://api.github.com/repos/Polymer/lit-html/languages","stargazers_url":"https://api.github.com/repos/Polymer/lit-html/stargazers","contributors_url":"https://api.github.com/repos/Polymer/lit-html/contributors","subscribers_url":"https://api.github.com/repos/Polymer/lit-html/subscribers","subscription_url":"https://api.github.com/repos/Polymer/lit-html/subscription","commits_url":"https://api.github.com/repos/Polymer/lit-html/commits{/sha}","git_commits_url":"https://api.github.com/repos/Polymer/lit-html/git/commits{/sha}","comments_url":"https://api.github.com/repos/Polymer/lit-html/comments{/number}","issue_comment_url":"https://api.github.com/repos/Polymer/lit-html/issues/comments{/number}","contents_url":"https://api.github.com/repos/Polymer/lit-html/contents/{+path}","compare_url":"https://api.github.com/repos/Polymer/lit-html/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Polymer/lit-html/merges","archive_url":"https://api.github.com/repos/Polymer/lit-html/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Polymer/lit-html/downloads","issues_url":"https://api.github.com/repos/Polymer/lit-html/issues{/number}","pulls_url":"https://api.github.com/repos/Polymer/lit-html/pulls{/number}","milestones_url":"https://api.github.com/repos/Polymer/lit-html/milestones{/number}","notifications_url":"https://api.github.com/repos/Polymer/lit-html/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Polymer/lit-html/labels{/name}","releases_url":"https://api.github.com/repos/Polymer/lit-html/releases{/id}","deployments_url":"https://api.github.com/repos/Polymer/lit-html/deployments","created_at":"2017-06-29T16:27:16Z","updated_at":"2018-11-20T21:41:25Z","pushed_at":"2018-11-20T21:41:19Z","git_url":"git://github.com/Polymer/lit-html.git","ssh_url":"git@github.com:Polymer/lit-html.git","clone_url":"https://github.com/Polymer/lit-html.git","svn_url":"https://github.com/Polymer/lit-html","homepage":"https://lit-html.polymer-project.org/","size":1947,"stargazers_count":3322,"watchers_count":3322,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":198,"mirror_url":null,"archived":false,"open_issues_count":107,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":198,"open_issues":107,"watchers":3322,"default_branch":"master"}},"base":{"label":"Polymer:master","ref":"master","sha":"881c25a2ead3fce155d115999202905fc66ac6dd","user":{"login":"Polymer","id":2159051,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxNTkwNTE=","avatar_url":"https://avatars3.githubusercontent.com/u/2159051?v=4","gravatar_id":"","url":"https://api.github.com/users/Polymer","html_url":"https://github.com/Polymer","followers_url":"https://api.github.com/users/Polymer/followers","following_url":"https://api.github.com/users/Polymer/following{/other_user}","gists_url":"https://api.github.com/users/Polymer/gists{/gist_id}","starred_url":"https://api.github.com/users/Polymer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polymer/subscriptions","organizations_url":"https://api.github.com/users/Polymer/orgs","repos_url":"https://api.github.com/users/Polymer/repos","events_url":"https://api.github.com/users/Polymer/events{/privacy}","received_events_url":"https://api.github.com/users/Polymer/received_events","type":"Organization","site_admin":false},"repo":{"id":95797174,"node_id":"MDEwOlJlcG9zaXRvcnk5NTc5NzE3NA==","name":"lit-html","full_name":"Polymer/lit-html","private":false,"owner":{"login":"Polymer","id":2159051,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxNTkwNTE=","avatar_url":"https://avatars3.githubusercontent.com/u/2159051?v=4","gravatar_id":"","url":"https://api.github.com/users/Polymer","html_url":"https://github.com/Polymer","followers_url":"https://api.github.com/users/Polymer/followers","following_url":"https://api.github.com/users/Polymer/following{/other_user}","gists_url":"https://api.github.com/users/Polymer/gists{/gist_id}","starred_url":"https://api.github.com/users/Polymer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polymer/subscriptions","organizations_url":"https://api.github.com/users/Polymer/orgs","repos_url":"https://api.github.com/users/Polymer/repos","events_url":"https://api.github.com/users/Polymer/events{/privacy}","received_events_url":"https://api.github.com/users/Polymer/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Polymer/lit-html","description":"An efficient, expressive, extensible HTML templating library for JavaScript.","fork":false,"url":"https://api.github.com/repos/Polymer/lit-html","forks_url":"https://api.github.com/repos/Polymer/lit-html/forks","keys_url":"https://api.github.com/repos/Polymer/lit-html/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Polymer/lit-html/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Polymer/lit-html/teams","hooks_url":"https://api.github.com/repos/Polymer/lit-html/hooks","issue_events_url":"https://api.github.com/repos/Polymer/lit-html/issues/events{/number}","events_url":"https://api.github.com/repos/Polymer/lit-html/events","assignees_url":"https://api.github.com/repos/Polymer/lit-html/assignees{/user}","branches_url":"https://api.github.com/repos/Polymer/lit-html/branches{/branch}","tags_url":"https://api.github.com/repos/Polymer/lit-html/tags","blobs_url":"https://api.github.com/repos/Polymer/lit-html/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Polymer/lit-html/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Polymer/lit-html/git/refs{/sha}","trees_url":"https://api.github.com/repos/Polymer/lit-html/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Polymer/lit-html/statuses/{sha}","languages_url":"https://api.github.com/repos/Polymer/lit-html/languages","stargazers_url":"https://api.github.com/repos/Polymer/lit-html/stargazers","contributors_url":"https://api.github.com/repos/Polymer/lit-html/contributors","subscribers_url":"https://api.github.com/repos/Polymer/lit-html/subscribers","subscription_url":"https://api.github.com/repos/Polymer/lit-html/subscription","commits_url":"https://api.github.com/repos/Polymer/lit-html/commits{/sha}","git_commits_url":"https://api.github.com/repos/Polymer/lit-html/git/commits{/sha}","comments_url":"https://api.github.com/repos/Polymer/lit-html/comments{/number}","issue_comment_url":"https://api.github.com/repos/Polymer/lit-html/issues/comments{/number}","contents_url":"https://api.github.com/repos/Polymer/lit-html/contents/{+path}","compare_url":"https://api.github.com/repos/Polymer/lit-html/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Polymer/lit-html/merges","archive_url":"https://api.github.com/repos/Polymer/lit-html/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Polymer/lit-html/downloads","issues_url":"https://api.github.com/repos/Polymer/lit-html/issues{/number}","pulls_url":"https://api.github.com/repos/Polymer/lit-html/pulls{/number}","milestones_url":"https://api.github.com/repos/Polymer/lit-html/milestones{/number}","notifications_url":"https://api.github.com/repos/Polymer/lit-html/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Polymer/lit-html/labels{/name}","releases_url":"https://api.github.com/repos/Polymer/lit-html/releases{/id}","deployments_url":"https://api.github.com/repos/Polymer/lit-html/deployments","created_at":"2017-06-29T16:27:16Z","updated_at":"2018-11-20T21:41:25Z","pushed_at":"2018-11-20T21:41:19Z","git_url":"git://github.com/Polymer/lit-html.git","ssh_url":"git@github.com:Polymer/lit-html.git","clone_url":"https://github.com/Polymer/lit-html.git","svn_url":"https://github.com/Polymer/lit-html","homepage":"https://lit-html.polymer-project.org/","size":1947,"stargazers_count":3322,"watchers_count":3322,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":198,"mirror_url":null,"archived":false,"open_issues_count":107,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":198,"open_issues":107,"watchers":3322,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Polymer/lit-html/pulls/640"},"html":{"href":"https://github.com/Polymer/lit-html/pull/640"},"issue":{"href":"https://api.github.com/repos/Polymer/lit-html/issues/640"},"comments":{"href":"https://api.github.com/repos/Polymer/lit-html/issues/640/comments"},"review_comments":{"href":"https://api.github.com/repos/Polymer/lit-html/pulls/640/comments"},"review_comment":{"href":"https://api.github.com/repos/Polymer/lit-html/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Polymer/lit-html/pulls/640/commits"},"statuses":{"href":"https://api.github.com/repos/Polymer/lit-html/statuses/fd9704518068d4e1d3028a895366f201c3fa507a"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"justinfagnani"}}