From 16fd1c76f7f3c93b3dd3f716f84d49df6813784a Mon Sep 17 00:00:00 2001 From: Alexander Harman Date: Mon, 18 Apr 2022 23:07:24 +0100 Subject: [PATCH] Fix trim option for empty tags --- lib/parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/parser.js b/lib/parser.js index eda231cb..927f006f 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -183,7 +183,7 @@ } s = stack[stack.length - 1]; if (obj[charkey].match(/^\s*$/) && !cdata) { - emptyStr = obj[charkey]; + emptyStr = _this.options.trim ? obj[charkey].trim() : obj[charkey]; delete obj[charkey]; } else { if (_this.options.trim) {