@coherent.js/core 1.0.0-rc.3 → 1.0.0-rc.4

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/index.js CHANGED
@@ -2101,6 +2101,16 @@ var HTMLRenderer = class extends BaseRenderer {
2101
2101
  const { children, text, key: _key, html: _rawHtml, ...attributes } = element || {};
2102
2102
  const attributeString = formatAttributes(attributes);
2103
2103
  const openingTag = attributeString ? `<${tagName} ${attributeString}>` : `<${tagName}>`;
2104
+ if (isVoidElement(tagName)) {
2105
+ if (options.enableCache && this.cache && RendererUtils.isCacheable(element, options)) {
2106
+ const cacheKey = RendererUtils.generateCacheKey(tagName, element);
2107
+ if (cacheKey) {
2108
+ this.cache.set(cacheKey, openingTag);
2109
+ }
2110
+ }
2111
+ this.recordPerformance(tagName, startTime, false);
2112
+ return openingTag;
2113
+ }
2104
2114
  if (_rawHtml !== void 0) {
2105
2115
  const rawContent = typeof _rawHtml === "function" ? String(_rawHtml()) : String(_rawHtml);
2106
2116
  const result = `${openingTag}${rawContent}</${tagName}>`;