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.
Files changed (2) hide show
  1. package/dist/server.mjs +2 -3
  2. 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
- if (tag.textContent)
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
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unhead",
3
3
  "type": "module",
4
- "version": "2.0.4",
4
+ "version": "2.0.6",
5
5
  "description": "Full-stack <head> manager built for any framework.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",