@khanacademy/perseus-linter 4.3.8 → 4.3.10

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
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var perseusUtils = require('@khanacademy/perseus-utils');
6
6
  var perseusCore = require('@khanacademy/perseus-core');
7
7
 
8
- const libName="@khanacademy/perseus-linter";const libVersion="4.3.8";perseusUtils.addLibraryVersionToPerseusDebug(libName,libVersion);
8
+ const libName="@khanacademy/perseus-linter";const libVersion="4.3.10";perseusUtils.addLibraryVersionToPerseusDebug(libName,libVersion);
9
9
 
10
10
  const linterContextDefault={contentType:"",highlightLint:false,paths:[],stack:[]};
11
11
 
@@ -62,8 +62,7 @@ var ImageWidget = Rule.makeRule({name:"image-widget",severity:Rule.Severity.WARN
62
62
  for accessibility, all images should have a text description.
63
63
  Add a description in the "Alt Text" box of the image widget.`}if(alt.trim().length<8){return `Images should have alt text:
64
64
  for accessibility, all images should have descriptive alt text.
65
- This image's alt text is only ${alt.trim().length} characters long.`}if(widget.options.caption&&widget.options.caption.match(/[^\\]\$/)){return `No math in image captions:
66
- Don't include math expressions in image captions.`}}});
65
+ This image's alt text is only ${alt.trim().length} characters long.`}}});
67
66
 
68
67
  var InaccessibleWidget = Rule.makeRule({name:"inaccessible-widget",severity:Rule.Severity.WARNING,selector:"widget",lint:function(state,content,nodes,match,context){const node=state.currentNode();const widgetType=node.widgetType;const widgetId=node.id;if(!widgetType||!widgetId){return}const widgetInfo=context?.widgets?.[widgetId];if(!widgetInfo){return}const accessible=perseusCore.CoreWidgetRegistry.isAccessible(widgetType,widgetInfo.options);if(!accessible){return {message:`The "${widgetType}" widget is not accessible.`,start:0,end:content.length,metadata:{widgetType:widgetType,widgetId:widgetId}}}}});
69
68