mirror of
https://github.com/minetest/minetest.git
synced 2025-03-06 20:48:40 +01:00
Chat: Remove tailing punctuation from clickable links
This commit is contained in:
parent
87232358d3
commit
08485f6781
1 changed files with 7 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue