Skip to content

Commit

Permalink
Fix tag whitespace not allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
Torm committed Jan 30, 2024
1 parent c0ece3a commit 6e7acd8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions cm-modes/khi.js
Original file line number Diff line number Diff line change
Expand Up @@ -785,24 +785,23 @@
}
replaceStack(state, {mode: STATE_TAG_NAME, macro: macro, argument: head.argument});
stream.next();
if (stream.eol()) {
pushStack(state, {mode: STATE_ERROR});
}
return macro ? STYLE_MACRO : STYLE_TAG;
} else {
pushStack(state, {mode: STATE_ERROR});
}
} else if (mode === STATE_TAG_NAME) {
// Skip whitespace. Expect command.
// Expect name.
let t = classifyCharacter(stream);
if (t === CLASS_WHITESPACE) {
pushStack(state, {mode: STATE_WHITESPACE});
} else if (t === CLASS_COMMENT_HASH) {
pushStack(state, {mode: STATE_COMMENT});
} else if (t === CLASS_GLYPH || t === CLASS_CHARACTER_ESCAPE_SEQUENCE || t === CLASS_REPEATED_ESCAPE_SEQUENCE) {
if (t === CLASS_GLYPH || t === CLASS_CHARACTER_ESCAPE_SEQUENCE || t === CLASS_REPEATED_ESCAPE_SEQUENCE) {
replaceStack(state, {mode: STATE_TAG_ATTRIBUTE, macro: head.macro, argument: head.argument});
pushStack(state, {mode: STATE_WORD, style: head.macro ? STYLE_MACRO : STYLE_TAG});
} else {
pushStack(state, {mode: STATE_ERROR});
}
} else if (mode === STATE_TAG_ATTRIBUTE) {
} else if (mode === STATE_TAG_ATTRIBUTE) { // TODO: Fix whitespace not allowed in tag production "<"name">"
// Skip whitespace. Expect attribute, otherwise end.
let t = classifyCharacter(stream);
if (t === CLASS_WHITESPACE) {
Expand Down

0 comments on commit 6e7acd8

Please sign in to comment.