@richscripts/richtexteditor 2.5.3 → 2.5.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.
@@ -408,7 +408,13 @@ function RTE_Plugin_AccessibilityChecker() {
408
408
  if (headingText) previousHeadingLevel = level;
409
409
  }
410
410
 
411
- var images = node.querySelectorAll ? node.querySelectorAll("img") : [];
411
+ // querySelectorAll only returns DESCENDANTS, so an image that is
412
+ // itself a top-level block — which is exactly where a pasted or
413
+ // dropped image lands in an empty editor — was never checked, and
414
+ // missing alt text went unreported. The table rule below already
415
+ // guards this case; the image rule did not. Measured 2026-08-27:
416
+ // bare top-level img => 0 issues, the same img inside a <p> => 1.
417
+ var images = tag === "img" ? [node] : (node.querySelectorAll ? node.querySelectorAll("img") : []);
412
418
  for (var imageIndex = 0; imageIndex < images.length; imageIndex++) {
413
419
  var image = images[imageIndex];
414
420
  if (!String(image.getAttribute("alt") || "").replace(/^\s+|\s+$/g, "")) {