#3859: Do not add control characters to the ClickEvent with OPEN_URL action

This commit is contained in:
Valentine
2025-07-07 20:50:01 +10:00
committed by md_5
parent 7fcc62067b
commit 131125c7d2
2 changed files with 22 additions and 1 deletions

View File

@@ -562,6 +562,13 @@ public class ComponentsTest
assertNotNull( url2 );
assertTrue( url2.getAction() == ClickEvent.Action.OPEN_URL );
assertEquals( "http://google.com/test", url2.getValue() );
BaseComponent[] test3 = TextComponent.fromLegacyText( "Text\nhttp://google.com\n newline3" );
ClickEvent url3 = test3[1].getClickEvent();
assertNotNull( url3 );
assertTrue( url3.getAction() == ClickEvent.Action.OPEN_URL );
assertEquals( "http://google.com", url3.getValue() );
assertEquals( "\n newline3", BaseComponent.toPlainText( test3[2] ) );
}
@Test