When using certain html-comments, can.view.Scanner does not recognize them correctly #598

Merged
merged 2 commits into from Dec 9, 2013

Conversation

Projects
None yet
4 participants
@ghost

ghost commented Dec 8, 2013

When using some html-comments (namely all comments, that don’t have a space/tab/newline after the starting <!—), can.view.Scanner incorrectly recognize them as tags instead of comments and therefore tries to bind them (which breaks other bindings).

This pull request contains a breaking test for the problem as well as a proposed fix.
Note: The fix will have a negative impact on overall-performance, though I find it too small to measure how much exactly (I just ran the mustache-tests with and without the fix, didn't make a difference that could not have been cause by normal variation).

0ff added some commits Dec 8, 2013

Added breaking test for the problem that some html-comments break can…
….view.Scanner (by being recognized as tags instead of comments)
Fixed a bug in can.view.Scanner that would recognize some html-commen…
…ts (namely all comments, that don’t have a space/tab/newline after the starting `<!—`) as tags instead of comments and therefore try to bind them (which breaks other bindings)

daffl added a commit that referenced this pull request Dec 9, 2013

Merge pull request #598 from simpleTechs/html-comments
When using certain html-comments, can.view.Scanner does not recognize them correctly

@daffl daffl merged commit 9852bfa into canjs:master Dec 9, 2013

1 check passed

default The Travis CI build passed
Details

@simpleTechs simpleTechs deleted the simpleTechs:html-comments branch Dec 9, 2013

@0ff 0ff restored the simpleTechs:html-comments branch Dec 12, 2013

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Dec 22, 2013

Contributor

Thanks for submitting this, but I'm not sure this is the right fix. This will make tagName an empty string. I'm not sure that's as nice as setting some "inComment" flag.

Contributor

justinbmeyer commented on 23d39e9 Dec 22, 2013

Thanks for submitting this, but I'm not sure this is the right fix. This will make tagName an empty string. I'm not sure that's as nice as setting some "inComment" flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment