mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
Chat: Remove tailing punctuation from clickable links
This commit is contained in:
@@ -376,6 +376,13 @@ u32 ChatBuffer::formatChatLine(const ChatLine &line, u32 cols,
|
||||
tempchar = linestring[in_pos+frag_length];
|
||||
}
|
||||
|
||||
// Remove tailing punctuation characters
|
||||
static const std::wstring tailing_chars = L",.";
|
||||
tempchar = linestring[in_pos+frag_length - 1];
|
||||
if (tailing_chars.find(tempchar) != std::wstring::npos) {
|
||||
frag_length--;
|
||||
}
|
||||
|
||||
space_pos = frag_length - 1;
|
||||
// This frag may need to be force-split. That's ok, urls aren't "words"
|
||||
if (frag_length >= remaining_in_output) {
|
||||
|
Reference in New Issue
Block a user