Skip to content

Commit 5f8525a

Browse files
committed
v1.1.2
Important YAML Bug Fix
1 parent 3499a64 commit 5f8525a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
}
44

55
group = 'dev.manere.inscript'
6-
version = '1.1.1'
6+
version = '1.1.2'
77

88
repositories {
99
mavenCentral()

src/main/java/dev/manere/inscript/format/YAMLFormat.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ private ConfigNode parseNode(@NotNull String line, final @NotNull BufferedReader
7676
final String value = line.substring(colonIndex + 1).trim();
7777

7878
if (value.isEmpty() || line.trim().endsWith(":")) {
79-
final String justRead = reader.readLine().trim();
79+
final String justRead = reader.readLine();
8080

81-
if (justRead.startsWith("-")) {
81+
if (justRead.trim().startsWith("-")) {
8282
final List<Object> list = new ArrayList<>();
8383

84-
if (!justRead.startsWith("-")) throw new InscriptException();
85-
final String justReadItemValue = justRead.substring(1).trim();
84+
if (!justRead.trim().startsWith("-")) throw new InscriptException();
85+
final String justReadItemValue = justRead.trim().substring(1).trim();
8686

8787
if (!justReadItemValue.trim().isEmpty()) {
8888
InlineValue<?> inlineMatched = new StringValue();
@@ -167,14 +167,14 @@ public String getKey() {
167167
section.getComments().addAll(tempComments);
168168
tempComments.clear();
169169

170-
String childLine = justRead;
171-
172170
final String justReadExpectedChildIndent = InscriptConstants.INDENT.get().apply(depth + 1);
173-
if (childLine.startsWith(justReadExpectedChildIndent) && !childLine.trim().startsWith("-")) {
174-
final ConfigNode childNode = parseNode(childLine, reader, depth + 1, tempComments);
171+
if (justRead.startsWith(justReadExpectedChildIndent) && !justRead.trim().startsWith("-")) {
172+
final ConfigNode childNode = parseNode(justRead, reader, depth + 1, tempComments);
175173
if (childNode != null) section.getChildren().add(childNode);
176174
}
177175

176+
String childLine;
177+
178178
while ((childLine = reader.readLine()) != null) {
179179
final String expectedChildIndent = InscriptConstants.INDENT.get().apply(depth + 1);
180180
if (!childLine.startsWith(expectedChildIndent) && !childLine.trim().startsWith("-")) break;

0 commit comments

Comments
 (0)