Skip to content

Commit 83f8d89

Browse files
committed
Fixed \n parsing in UI DSL
1 parent d771465 commit 83f8d89

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

core/src/mindustry/ui/builder/UiDslParser.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ private String parseString(){
126126
StringBuilder sb = new StringBuilder();
127127
while(!atEnd() && peek() != '"'){
128128
char c = src.charAt(pos);
129-
if(c == '\\' && pos + 1 < src.length()){ sb.append(src.charAt(pos + 1)); pos += 2; continue; }
129+
if(c == '\\' && pos + 1 < src.length()){
130+
char next = src.charAt(pos + 1);
131+
sb.append(next == 'n' ? '\n' : next); //parse \n
132+
pos += 2;
133+
continue;
134+
}
130135
sb.append(c);
131136
pos++;
132137
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ org.gradle.caching=true
2626
org.gradle.internal.http.socketTimeout=100000
2727
org.gradle.internal.http.connectionTimeout=100000
2828
android.enableR8.fullMode=false
29-
archash=6e8f4ebeb1
29+
archash=bd04d32df8

0 commit comments

Comments
 (0)