unhead 2.0.4 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.mjs +2 -3
- package/package.json +1 -1
package/dist/server.mjs
CHANGED
|
@@ -162,9 +162,8 @@ function tagToString(tag) {
|
|
|
162
162
|
const openTag = `<${tag.tag}${attrs}>`;
|
|
163
163
|
if (!TagsWithInnerContent.has(tag.tag))
|
|
164
164
|
return SelfClosingTags$1.has(tag.tag) ? openTag : `${openTag}</${tag.tag}>`;
|
|
165
|
-
let content = String(tag.innerHTML || "");
|
|
166
|
-
|
|
167
|
-
content = escapeHtml(String(tag.textContent));
|
|
165
|
+
let content = String(tag.textContent || tag.innerHTML || "");
|
|
166
|
+
content = tag.tag === "title" ? escapeHtml(content) : content.replace(new RegExp(`</${tag.tag}`, "gi"), `<\\/${tag.tag}`);
|
|
168
167
|
return SelfClosingTags$1.has(tag.tag) ? openTag : `${openTag}${content}</${tag.tag}>`;
|
|
169
168
|
}
|
|
170
169
|
|