KyoriPowered / adventure

A user-interface library, formerly known as text, for Minecraft: Java Edition
https://docs.advntr.dev/
MIT License
679 stars 104 forks source link

`MiniMessage::escapeTags` does not escape escape characters #998

Open homchom opened 7 months ago

homchom commented 7 months ago

MiniMessage::escapeTags does not replace single backslashes (\) with double blackslashes (\\), preventing it from being useful in escaping literal strings for deserialization. It is unclear whether this is intended behavior or not, but I figure it is not, because otherwise what is the use case of such a function?

A workaround for now is to escape using serialization, specifically MiniMessage.miniMessage().serialize(Component.text(input)). This works (despite what #997 says) but is suboptimal.