書式に含まれる部品の目印を取り除く

このコミットが含まれているのは:
routersys committed 2026-09-12 11:31:06 +09:00
1 親 d04cb3ef24
コミット 29c23c8a6f
2ファイル変更
+12 -2

検索条件に一致するファイルはありません

+2 -2
ファイルの表示
@@ -71,7 +71,7 @@ public class ClickableFormat {
LunaChatAPI api = LunaChat.getAPI();
ClickableFormat msg = new ClickableFormat(new KeywordReplacer(Utility.replaceColorCode(format)));
ClickableFormat msg = new ClickableFormat(new KeywordReplacer(Utility.replaceColorCode(withoutPartMarkers(format))));
if ( channel != null ) {
@@ -141,7 +141,7 @@ public class ClickableFormat {
*/
public static ClickableFormat makeChannelClickableMessage(String format, String channelName) {
ClickableFormat msg = new ClickableFormat(new KeywordReplacer(Utility.replaceColorCode(format)));
ClickableFormat msg = new ClickableFormat(new KeywordReplacer(Utility.replaceColorCode(withoutPartMarkers(format))));
String stripped = Utility.stripColorCode(channelName);
msg.replaceWithRunCommand("%channel%",
channelName,
+10
ファイルの表示
@@ -121,6 +121,16 @@ public class ClickableFormatTest extends TestCase {
assertNotNull(findByClickEvent(comps, ClickEvent.runCommand("/lunachat join r")));
}
public void testTemplateMarkersAreDropped() {
ClickableFormat f = ClickableFormat.makeFormat("\uE0009\uE001%username: %msg", new ChannelMemberDummy());
f.replaceMessage("%msg", "hello");
Component comps = f.makeComponent();
assertEquals("9うっちぃ: hello", plain(comps));
assertEquals(1, countClickEvents(comps));
}
public void testChannelMessage() {
Component comps = Messages.joinMessage("&b", "r", "ucchy");