File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
application/src/main/java/org/togetherjava/tjbot/commands/utils Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -180,15 +180,15 @@ public static Optional<CodeFence> extractCode(String fullMessage) {
180180 return Optional .empty ();
181181 }
182182
183- int codeFenceEnd = fullMessage .indexOf (CODE_FENCE_SYMBOL , codeFenceStart + 1 );
183+ int languageStart = codeFenceStart + CODE_FENCE_SYMBOL .length ();
184+ int codeFenceEnd = fullMessage .indexOf (CODE_FENCE_SYMBOL , languageStart );
184185 if (codeFenceEnd == -1 ) {
185186 return Optional .empty ();
186187 }
187188
188189 // Language is between ``` and newline, no spaces allowed, like ```java
189190 // Look for the next newline and then assert no space between
190191 String language = null ;
191- int languageStart = codeFenceStart + CODE_FENCE_SYMBOL .length ();
192192 int languageEnd = fullMessage .indexOf ('\n' , codeFenceStart );
193193 if (languageEnd != -1 ) {
194194 String languageCandidate = fullMessage .substring (languageStart , languageEnd );
You can’t perform that action at this time.
0 commit comments