mirror of
https://github.com/Haui1112/minetest.git
synced 2024-10-22 23:31:50 +02:00
Chat: Remove tailing punctuation from clickable links
This commit is contained in:
parent
87232358d3
commit
08485f6781
|
@ -376,6 +376,13 @@ u32 ChatBuffer::formatChatLine(const ChatLine &line, u32 cols,
|
||||||
tempchar = linestring[in_pos+frag_length];
|
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;
|
space_pos = frag_length - 1;
|
||||||
// This frag may need to be force-split. That's ok, urls aren't "words"
|
// This frag may need to be force-split. That's ok, urls aren't "words"
|
||||||
if (frag_length >= remaining_in_output) {
|
if (frag_length >= remaining_in_output) {
|
||||||
|
|
Loading…
Reference in a new issue