Skip to content

Commit

Permalink
fix compiler to automatically handle unclosed elements
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Feb 15, 2017
1 parent d1307ed commit 57962f2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@

var lexText = function (state) {
var input = state.input;
var len = input.length;
var endOfText = input.indexOf("<", state.current);
// Only Text
if (endOfText === -1) {
Expand Down Expand Up @@ -684,15 +685,14 @@
if (token) {
// Find Closing Tag, and push children recursively
while (token.type !== "tagStart" || token.type === "tagStart" && !token.close) {
// Push a child to the current node
// Push a parsed child to the current node
var parsedChildState = walk(state);
if (parsedChildState) {
node.children.push(parsedChildState);
}
increment(0);

if (!token) {
state.current = startContentIndex - 1;
// No token means that there is nothing left to parse in this element
break;
}
}
Expand Down
Loading

0 comments on commit 57962f2

Please sign in to comment.