mnfst 0.5.59 → 0.5.60
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/lib/manifest.code.js +13 -4
- package/package.json +1 -1
package/lib/manifest.code.js
CHANGED
|
@@ -366,10 +366,19 @@ function initializeCodePlugin() {
|
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
connectedCallback() {
|
|
369
|
-
|
|
370
|
-
//
|
|
371
|
-
//
|
|
372
|
-
|
|
369
|
+
// Idempotency: if the element already has a fully-rendered structure
|
|
370
|
+
// (a <pre><code> child from prerender output), skip the rebuild.
|
|
371
|
+
// Reading innerHTML and re-setting it as textContent (extractContent
|
|
372
|
+
// line ~524) treats the prerendered hljs <span> markup as code
|
|
373
|
+
// source, producing nested highlight-of-highlight output.
|
|
374
|
+
const alreadyRendered =
|
|
375
|
+
this.querySelector(':scope > pre > code') &&
|
|
376
|
+
(this.hasAttribute('data-pre-rendered') ||
|
|
377
|
+
this.querySelector(':scope > pre > code.hljs, :scope > pre > code[data-highlighted="yes"]'));
|
|
378
|
+
if (!alreadyRendered) {
|
|
379
|
+
this.setupElement();
|
|
380
|
+
this.highlightCode();
|
|
381
|
+
}
|
|
373
382
|
}
|
|
374
383
|
|
|
375
384
|
attributeChangedCallback(name, oldValue, newValue) {
|