mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
i18n: do not escape \n (IDEA-95743)
This commit is contained in:
@@ -51,6 +51,9 @@ public class ResourceBundleUtil {
|
||||
escaped = true;
|
||||
continue;
|
||||
}
|
||||
if (escaped && c == 'n') {
|
||||
buffer.append(ESCAPE_SYMBOL);
|
||||
}
|
||||
buffer.append(c);
|
||||
escaped = false;
|
||||
}
|
||||
@@ -70,11 +73,21 @@ public class ResourceBundleUtil {
|
||||
char c = text.charAt(i);
|
||||
|
||||
if ((i == 0 && (c == ' ' || c == '\t')) // Leading white space
|
||||
|| c == '\n' // Multi-line value
|
||||
|| c == ESCAPE_SYMBOL // Escaped 'escape' symbol
|
||||
|| c == '\n' // Multi-line value
|
||||
|| SYMBOLS_TO_ESCAPE.contains(c)) // Special symbol
|
||||
{
|
||||
buffer.append(ESCAPE_SYMBOL);
|
||||
}
|
||||
else if (c == ESCAPE_SYMBOL) // Escaped 'escape' symbol)
|
||||
{
|
||||
if (text.length() > i + 1) {
|
||||
final char nextChar = text.charAt(i + 1);
|
||||
if (nextChar != 'n') {
|
||||
buffer.append(ESCAPE_SYMBOL);
|
||||
}
|
||||
} else {
|
||||
buffer.append(ESCAPE_SYMBOL);
|
||||
}
|
||||
}
|
||||
buffer.append(c);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user