lexxy 0.9.15.alpha.3 → 0.9.15.alpha.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 758b1f1f9dd31221578b28569d603273558efcbaeebc99203285a4285ff59d6c
4
- data.tar.gz: bd65292f31f4db5b6d25fc0c70a19599928e9da0739a9721b65ae9d6cc8bc397
3
+ metadata.gz: 0ed84486acc1dd14ca8115810af473196b728becab0923ceb46abe248462b494
4
+ data.tar.gz: d0f78f873024dbb0851bbf5482926f8fc14e894f70963ba9855e351ac0757e17
5
5
  SHA512:
6
- metadata.gz: e8e50606eb9aa824521c69b1112ccf6396fce303a7a3723c63b8136cfa43af38ea03778f1ae53a392d80209b791509be22c7dbed2c95f834ab042c9a1fc5d489
7
- data.tar.gz: e5b074bcb11f33916ee1d2b82db4552ea8302ba5f75cc61fbfce7c9ad2342d3a189582cf3d0a44404c74c8c99d692d1674994189dd76a20eb56d7f76721f7523
6
+ metadata.gz: 0314c9b63c0270154e62ac1976a4784153b710107209dc928251e5891ae46afc5ee3eb345d0e3dcf8e123497be49ceac0de666b9f9313849be89919eba4246ee
7
+ data.tar.gz: 763c0f8830fa0b6254a67b5af876db8814471e01edc6642c3dd9d52c0132abad6ce4e1bf4dda4a1ef83aad1d9f5791f7d76581ac063f6b4c6680154cdfecaa5a
@@ -16475,8 +16475,8 @@ function defineElements() {
16475
16475
  });
16476
16476
  }
16477
16477
 
16478
- function highlightCode() {
16479
- const elements = document.querySelectorAll("pre[data-language]");
16478
+ function highlightCode(root = document) {
16479
+ const elements = root.querySelectorAll("pre[data-language]:not([data-highlighted])");
16480
16480
 
16481
16481
  elements.forEach(preElement => {
16482
16482
  highlightElement(preElement);
@@ -16484,6 +16484,8 @@ function highlightCode() {
16484
16484
  }
16485
16485
 
16486
16486
  function highlightElement(preElement) {
16487
+ if (preElement.dataset.highlighted === "true") return
16488
+
16487
16489
  const language = preElement.getAttribute("data-language");
16488
16490
  let code = preElement.innerHTML.replace(/<br\s*\/?>/gi, "\n");
16489
16491
 
@@ -16502,6 +16504,8 @@ function highlightElement(preElement) {
16502
16504
  if (highlights.length > 0) {
16503
16505
  applyHighlightRanges(preElement, highlights);
16504
16506
  }
16507
+
16508
+ preElement.dataset.highlighted = "true";
16505
16509
  }
16506
16510
 
16507
16511
  // Walk the DOM tree inside a <pre> element and build a list of
@@ -16710,5 +16714,5 @@ const configure = Lexxy.configure;
16710
16714
  // Pushing elements definition to after the current call stack to allow global configuration to take place first
16711
16715
  setTimeout(defineElements, 0);
16712
16716
 
16713
- export { $createActionTextAttachmentNode, $createActionTextAttachmentUploadNode, $isActionTextAttachmentNode, ActionTextAttachmentNode, ActionTextAttachmentUploadNode, CustomActionTextAttachmentNode, LexxyExtension as Extension, HorizontalDividerNode, NativeAdapter, configure, highlightCode };
16717
+ export { $createActionTextAttachmentNode, $createActionTextAttachmentUploadNode, $isActionTextAttachmentNode, ActionTextAttachmentNode, ActionTextAttachmentUploadNode, CustomActionTextAttachmentNode, LexxyExtension as Extension, HorizontalDividerNode, NativeAdapter, configure, highlightCode, highlightElement };
16714
16718
  //# sourceMappingURL=lexxy.js.map
Binary file
Binary file