Skip to content

Commit

Permalink
make lexer more flexible and allow '<' in html
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed May 20, 2017
1 parent c5805ba commit fd7c4ef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@
}
};

var tagOrCommentStartRE = /<[\w/]\s*|<!--/;
var tagOrCommentStartRE = /<\/?(?:[A-Za-z]+\w*)|<!--/;

var lex = function (input) {
var state = {
Expand Down Expand Up @@ -1128,23 +1128,23 @@

// Lex Starting of Tag
var isClosingStart = input.charAt(current + 1) === "/";
state.current += isClosingStart ? 2 : 1;
state.current += isClosingStart === true ? 2 : 1;

// Lex type and attributes
var tagToken = lexTagType(state);
lexAttributes(tagToken, state);

// Lex ending tag
var isClosingEnd = input.charAt(current) === "/";
state.current += isClosingEnd ? 2 : 1;
state.current += isClosingEnd === true ? 2 : 1;

// Check if Closing Start
if (isClosingStart) {
if (isClosingStart === true) {
tagToken.closeStart = true;
}

// Check if Closing End
if (isClosingEnd) {
if (isClosingEnd === true) {
tagToken.closeEnd = true;
}
};
Expand Down
Loading

0 comments on commit fd7c4ef

Please sign in to comment.