diff --git a/src/htmlparser.lua b/src/htmlparser.lua
index 6ec174b..c029eb5 100644
--- a/src/htmlparser.lua
+++ b/src/htmlparser.lua
@@ -50,9 +50,9 @@ local function parse(text,limit)
function(...)return g(5,...)end
):gsub(
[=[(['"])]=]..
- [=[([^'>"]-)]=]..
+ [=[([^'">%s]-)]=]..
"(>)"..
- [=[([^'>"]-)]=]..
+ [=[([^'">%s]-)]=]..
[=[(['"])]=],
function(...)return g(3,...)end
)