From 28f5b57cd574bec1aece8c55f246da8d423201e7 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Fri, 25 Mar 2022 00:43:58 -0400 Subject: [PATCH] fix inline icons being detected as bulletpoints --- eid_api.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eid_api.lua b/eid_api.lua index c9d42b61..75dbcee8 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -773,6 +773,8 @@ function EID:fitTextToWidth(str, textboxWidth, breakUtf8Chars) local formattedLines = {} local curLength = 0 local text = {} + -- the first word we run into might actually be a bulletpoint icon, which should be zero width + local isBulletpoint = true local cursor = 1 local word_begin_index = 1 @@ -840,7 +842,8 @@ function EID:fitTextToWidth(str, textboxWidth, breakUtf8Chars) -- we can break after str[cursor] local word = sub(str, word_begin_index, cursor) - local wordFiltered = EID:replaceAllMarkupWithSpaces(word, curLength == 0) + local wordFiltered = EID:replaceAllMarkupWithSpaces(word, isBulletpoint) + isBulletpoint = false local wordLength = EID:getStrWidth(wordFiltered) if curLength + wordLength <= textboxWidth or curLength < 17 then