diff --git a/core/src/main/kotlin/eu/iamgio/quarkdown/lexer/patterns/FunctionCallPatterns.kt b/core/src/main/kotlin/eu/iamgio/quarkdown/lexer/patterns/FunctionCallPatterns.kt index 11594b62..210be581 100644 --- a/core/src/main/kotlin/eu/iamgio/quarkdown/lexer/patterns/FunctionCallPatterns.kt +++ b/core/src/main/kotlin/eu/iamgio/quarkdown/lexer/patterns/FunctionCallPatterns.kt @@ -38,8 +38,11 @@ class FunctionCallPatterns { TokenRegexPattern( name = "FunctionCall", wrap = { FunctionCallToken(it, isBlock = true) }, + // The current operation to make sure the function call is not followed by other non-function content + // is just checking if the line ends with an argument end character (}). + // This works in most cases, but it should be improved soon with some better check. regex = - RegexBuilder("^ {0,3}call") + RegexBuilder("^ {0,3}call(?=(?:.*})?\\s*\$)") .withReference("call", inlineFunctionCall.regex.pattern) .build(), // Arguments are scanned by the walker lexer. diff --git a/core/src/test/resources/lexing/blocks.md b/core/src/test/resources/lexing/blocks.md index f44c1ade..c02eedaa 100644 --- a/core/src/test/resources/lexing/blocks.md +++ b/core/src/test/resources/lexing/blocks.md @@ -70,6 +70,8 @@ Paragraph - A - B +.inlinefunction {arg1} {arg2} {arg3} + .blockfunction {arg1} {arg2} {arg3} .inlinefunction {arg1} {arg2} text