diff --git a/src/main/java/org/mapstruct/intellij/expression/JavaExpressionInjector.java b/src/main/java/org/mapstruct/intellij/expression/JavaExpressionInjector.java index 7b246e7..8669e25 100644 --- a/src/main/java/org/mapstruct/intellij/expression/JavaExpressionInjector.java +++ b/src/main/java/org/mapstruct/intellij/expression/JavaExpressionInjector.java @@ -49,7 +49,7 @@ */ public class JavaExpressionInjector implements MultiHostInjector { - public static final Pattern JAVA_EXPRESSION = Pattern.compile( "\" *java\\(.*\\) *\"" ); + public static final Pattern JAVA_EXPRESSION = Pattern.compile( "^\"\\s*java\\((.*)\\)\\s*\"$", Pattern.DOTALL ); private static final ElementPattern PATTERN = StandardPatterns.or(