@khanacademy/perseus-linter 0.0.0-PR3057-20251120233511 → 0.0.0-PR3057-20251121222126

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/es/index.js CHANGED
@@ -3,7 +3,7 @@ import { PerseusError, Errors, CoreWidgetRegistry, makeSafeUrl } from '@khanacad
3
3
  import * as KAS from '@khanacademy/kas';
4
4
  import { parse, traverseContent } from '@khanacademy/pure-markdown';
5
5
 
6
- const libName="@khanacademy/perseus-linter";const libVersion="4.4.7";addLibraryVersionToPerseusDebug(libName,libVersion);
6
+ const libName="@khanacademy/perseus-linter";const libVersion="4.5.0";addLibraryVersionToPerseusDebug(libName,libVersion);
7
7
 
8
8
  const linterContextDefault={contentType:"",highlightLint:false,paths:[],stack:[]};
9
9
 
@@ -79,7 +79,7 @@ var LongParagraph = Rule.makeRule({name:"long-paragraph",severity:Rule.Severity.
79
79
  This paragraph is ${content.length} characters long.
80
80
  Shorten it to 500 characters or fewer.`}});
81
81
 
82
- var MatcherWidgetError = Rule.makeRule({name:"matcher-widget-error",severity:Rule.Severity.ERROR,selector:"widget",lint:function(state,content,nodes,match,context){if(state.currentNode().widgetType!=="matcher"){return}const nodeId=state.currentNode().id;if(!nodeId){return}const widget=context&&context.widgets&&context.widgets[nodeId];if(!widget){return}if(widget.options.left.length!==widget.options.right.length){return "The two halves of the matcher have different numbers of cards."}}});
82
+ var MatcherWidgetError = Rule.makeRule({name:"matcher-widget-error",severity:Rule.Severity.ERROR,selector:"widget",lint:function(state,content,nodes,match,context){if(state.currentNode().widgetType!=="matcher"){return}const nodeId=state.currentNode().id;if(!nodeId){return}const widget=context?.widgets?.[nodeId];if(!widget){return}if(widget.options.left.length!==widget.options.right.length){return "The two halves of the matcher have different numbers of cards."}}});
83
83
 
84
84
  var MathAdjacent = Rule.makeRule({name:"math-adjacent",severity:Rule.Severity.WARNING,selector:"blockMath+blockMath",message:`Adjacent math blocks:
85
85
  combine the blocks between \\begin{align} and \\end{align}`});