From b8faba2cfa1840b80fdb35c56787582dc32ddfa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ritzl?= Date: Fri, 2 Mar 2018 17:19:50 +0100 Subject: [PATCH] Fix with img tags not working --- richtext/parse.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/richtext/parse.lua b/richtext/parse.lua index 5e5ca29..73977ad 100644 --- a/richtext/parse.lua +++ b/richtext/parse.lua @@ -134,7 +134,7 @@ function M.parse(text, word_settings) assert(text) assert(word_settings) local all_words = {} - while #text > 0 do + repeat local before, tag, params, text_in_tag, after = find_tag(text) -- no more tags? Split and add the entire string if not tag then @@ -161,9 +161,9 @@ function M.parse(text, word_settings) for _,word in ipairs(inner_words) do all_words[#all_words + 1] = word end - + text = after - end + until text == "" return all_words end