From 554daec953a8b7e6e14b51c0d35354ac5b98f005 Mon Sep 17 00:00:00 2001 From: Guilian Date: Sat, 25 Jan 2025 17:01:50 +0100 Subject: [PATCH] refactor: improve quoted values matching --- html.lua | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/html.lua b/html.lua index 07815fd..fcc5696 100644 --- a/html.lua +++ b/html.lua @@ -356,16 +356,13 @@ function M.tokenise( content ) end end - if char == "'" or char == '"' then - if currently_opened_quotes == char then + -- found matching closing quote type + if char == currently_opened_quotes then currently_opened_quotes = nil - else + elseif currently_opened_quotes == nil then currently_opened_quotes = char end - - text_memory = text_memory .. char - goto continue end text_memory = text_memory .. char