Skip to content

Commit

Permalink
allow lexer to handle unclosed elements (fixes #35)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Apr 15, 2017
1 parent 3fd477a commit 5c08af7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@
var lexText = function (state) {
var input = state.input;
var len = input.length;
var endOfText = input.substring(state.current).search(tagStartRE) + state.current;
var endOfText = input.substring(state.current).search(tagStartRE);

// Only Text
if (endOfText === -1) {
Expand All @@ -1012,11 +1012,12 @@
}

// No Text at All
if (endOfText === state.current) {
if (endOfText === 0) {
return;
}

// End of Text Found
endOfText += state.current;
state.tokens.push({
type: "text",
value: input.slice(state.current, endOfText)
Expand Down

0 comments on commit 5c08af7

Please sign in to comment.