From 5fd0718b7184452a0a0eda6309f94c285dbc2969 Mon Sep 17 00:00:00 2001 From: Thomas Schouten Date: Wed, 25 Dec 2024 14:29:21 +0100 Subject: [PATCH] Allow whitespace between href command and argument --- src/nl/hannahsten/texifyidea/grammar/LatexLexer.flex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nl/hannahsten/texifyidea/grammar/LatexLexer.flex b/src/nl/hannahsten/texifyidea/grammar/LatexLexer.flex index 3fa654195..e9fc6686c 100644 --- a/src/nl/hannahsten/texifyidea/grammar/LatexLexer.flex +++ b/src/nl/hannahsten/texifyidea/grammar/LatexLexer.flex @@ -214,8 +214,10 @@ END_IFS=\\fi } { - { 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; }