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) {
180
180
return Optional .empty ();
181
181
}
182
182
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 );
184
185
if (codeFenceEnd == -1 ) {
185
186
return Optional .empty ();
186
187
}
187
188
188
189
// Language is between ``` and newline, no spaces allowed, like ```java
189
190
// Look for the next newline and then assert no space between
190
191
String language = null ;
191
- int languageStart = codeFenceStart + CODE_FENCE_SYMBOL .length ();
192
192
int languageEnd = fullMessage .indexOf ('\n' , codeFenceStart );
193
193
if (languageEnd != -1 ) {
194
194
String languageCandidate = fullMessage .substring (languageStart , languageEnd );
You can’t perform that action at this time.
0 commit comments