only flag spaces if we haven't met an underscore

This commit is contained in:
PiggyPiglet
2026-02-25 21:13:05 +08:00
parent 1807b92505
commit 7286d8849b

View File

@@ -87,8 +87,8 @@ public final class CharsReplacer implements Replacer {
for (int i = startPlaceholder + 1; i < endPlaceholder; i++) { for (int i = startPlaceholder + 1; i < endPlaceholder; i++) {
final char current = text.charAt(i); final char current = text.charAt(i);
if (current == ' ') { if (current == ' ' && underscoreIndex == -1) {
// Invalid placeholder (contains space). // Invalid placeholder (contains space before _).
// Treat the opening symbol as literal text and search for the next one. // Treat the opening symbol as literal text and search for the next one.
builder.append(head); builder.append(head);
cursor = startPlaceholder + 1; cursor = startPlaceholder + 1;