Skip to content

Commit

Permalink
Compact for complex tags too
Browse files Browse the repository at this point in the history
  • Loading branch information
imDaniX committed Apr 28, 2023
1 parent 4670d23 commit 2c928ed
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Add to dependencies
<dependency>
<groupId>ink.glowing</groupId>
<artifactId>inkymessage</artifactId>
<version>0.9.1</version> <!-- Check the version above -->
<version>0.9.2</version> <!-- Check the version above -->
</dependency>
```
### Gradle
Expand All @@ -57,6 +57,6 @@ repositories {
}

dependencies {
implementation("ink.glowing:inkymessage:0.9.1") // Check the version above
implementation("ink.glowing:inkymessage:0.9.2") // Check the version above
}
```
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ink.glowing</groupId>
<artifactId>inkymessage</artifactId>
<version>0.9.1</version>
<version>0.9.2</version>

<properties>
<adventure.version>4.13.1</adventure.version>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ink/glowing/text/IMDeserializerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private IMDeserializerImpl(@NotNull String textStr, @NotNull InkyMessage.Resolve
comp = plainTag.modify(comp, params, value);
} else if (tag instanceof StyleTag.Complex complexTag) {
Component value = parseInner(from, ')', context.colorlessCopy());
comp = complexTag.modify(comp, params, value);
comp = complexTag.modify(comp, params, value.compact());
}
}
if (++globalIndex < textStr.length() && textStr.charAt(globalIndex) == '(') {
Expand Down
7 changes: 7 additions & 0 deletions src/test/java/ink/glowing/text/InkyMessageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ public Object[][] deserializeData() {
text("aaa").color(RED)
.append(text("bbb").decorate(ITALIC).append(text("ccc").decorate(BOLD)).append(text("bbb")))
.append(text("aaa").color(WHITE))
},
{
"&cSome &[hover parsing](hover:text &atest!).",
text()
.append(text("Some ").color(RED))
.append(text("hover parsing").color(RED).hoverEvent(showText(text("test!").color(GREEN))))
.append(text(".").color(RED)).build()
}
};
}
Expand Down

0 comments on commit 2c928ed

Please sign in to comment.