-
Notifications
You must be signed in to change notification settings - Fork 141
Tailor fails to parse template with comments inside #191
Conversation
Codecov Report
@@ Coverage Diff @@
## master #191 +/- ##
=======================================
Coverage 98.29% 98.29%
=======================================
Files 14 14
Lines 586 586
Branches 104 104
=======================================
Hits 576 576
Misses 10 10 Continue to review full report at Codecov.
|
👍 |
1 similar comment
👍 |
/cc @vigneshshanmugam, check once you're back :) |
if (!treeAdapter.isTextNode(node)) { | ||
if ( | ||
!treeAdapter.isTextNode(node) && | ||
!treeAdapter.isCommentNode(node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be handled in this way..
This fix mean would completely skip comment nodes from child templates which is not the expected output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, so why do we handle text nodes like?
Tomorrow I will take a look on passing it through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, so why do we handle text nodes like?
yup, that was a bit puzzling, thus was thinking it's ok to have comments handled the same way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally forgot why i did it that way. Will update once i remember.
But, with the fix #195, we can even include text nodes(space) as part of child templates.
For some reason tailor fails to parse templates with HTML comments inside.
Judging by the error message and some snippets in the code, it seem like handling of comments is different from how other tags are processed.