Skip to content

Commit

Permalink
Allow whitespace between href command and argument
Browse files Browse the repository at this point in the history
  • Loading branch information
PHPirates committed Dec 25, 2024
1 parent 94ed528 commit 5fd0718
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/nl/hannahsten/texifyidea/grammar/LatexLexer.flex
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,10 @@ END_IFS=\\fi
}

<URL_VERBATIM> {
{ OPEN_BRACE } { verbatimUrlBracesCount++; return OPEN_BRACE; }
{ CLOSE_BRACE } { verbatimUrlBracesCount--; if (verbatimUrlBracesCount == 0) { yypopState(); } return CLOSE_BRACE; }
{OPEN_BRACE} { verbatimUrlBracesCount++; return OPEN_BRACE; }
{CLOSE_BRACE} { verbatimUrlBracesCount--; if (verbatimUrlBracesCount == 0) { yypopState(); } return CLOSE_BRACE; }
// There can be whitespace between command and argument
{WHITE_SPACE} { return com.intellij.psi.TokenType.WHITE_SPACE; }
{ANY_CHAR} { return RAW_TEXT_TOKEN; }
// Because the state is exclusive, we have to handle bad characters here as well (in case of an open \verb|... for example)
[^] { return com.intellij.psi.TokenType.BAD_CHARACTER; }
Expand Down

0 comments on commit 5fd0718

Please sign in to comment.