aboutsummaryrefslogtreecommitdiff
path: root/src/Text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text.cpp')
-rw-r--r--src/Text.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Text.cpp b/src/Text.cpp
index 0e24e73..5c8db41 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -170,14 +170,20 @@ namespace dchat
size_t urlStart = textElementStr.find(StringViewUtf32(urlStr.getData(), urlStr.getSize()), offset);
if(urlStart != -1)
{
+ bool foundDot = false;
offset = urlStart + urlStr.getSize();
while(offset < textElementStr.size)
{
if(isspace(textElementStr[offset]))
break;
+ else if(textElementStr[offset] == '.')
+ foundDot = true;
++offset;
}
+ if(!foundDot)
+ return -1;
+
StringViewUtf32 beforeUrlStr(textElementStr.data + stringStart, urlStart - stringStart);
newTextElements.push_back({ beforeUrlStr, TextElement::Type::TEXT });