@khanacademy/perseus-linter 4.4.1 → 4.4.3
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 +2 -2
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var perseusUtils = require('@khanacademy/perseus-utils');
|
|
|
6
6
|
var perseusCore = require('@khanacademy/perseus-core');
|
|
7
7
|
var pureMarkdown = require('@khanacademy/pure-markdown');
|
|
8
8
|
|
|
9
|
-
const libName="@khanacademy/perseus-linter";const libVersion="4.4.
|
|
9
|
+
const libName="@khanacademy/perseus-linter";const libVersion="4.4.3";perseusUtils.addLibraryVersionToPerseusDebug(libName,libVersion);
|
|
10
10
|
|
|
11
11
|
const linterContextDefault={contentType:"",highlightLint:false,paths:[],stack:[]};
|
|
12
12
|
|
|
@@ -63,7 +63,7 @@ Whitespace in image URLs causes translation difficulties.`}}}});
|
|
|
63
63
|
|
|
64
64
|
var ImageUrlEmpty = Rule.makeRule({name:"image-url-empty",severity:Rule.Severity.ERROR,selector:"image",lint:function(state,content,nodes){const image=nodes[0];const url=image.target;if(!url||!url.trim()){return "Images should have a URL"}}});
|
|
65
65
|
|
|
66
|
-
var ImageWidget = Rule.makeRule({name:"image-widget",severity:Rule.Severity.WARNING,selector:"widget",lint:function(state,content,nodes,match,context){if(state.currentNode().widgetType!=="image"){return}const nodeId=state.currentNode().id;if(!nodeId){return}const widget=context&&context.widgets&&context.widgets[nodeId];if(!widget){return}const alt=widget.options.alt;if(!alt){return `Images should have alt text:
|
|
66
|
+
var ImageWidget = Rule.makeRule({name:"image-widget",severity:Rule.Severity.WARNING,selector:"widget",lint:function(state,content,nodes,match,context){if(state.currentNode().widgetType!=="image"){return}const nodeId=state.currentNode().id;if(!nodeId){return}const widget=context&&context.widgets&&context.widgets[nodeId];if(!widget){return}if(widget.options.decorative){return}const alt=widget.options.alt;if(!alt){return `Images should have alt text:
|
|
67
67
|
for accessibility, all images should have a text description.
|
|
68
68
|
Add a description in the "Alt Text" box of the image widget.`}if(alt.trim().length<8){return `Images should have alt text:
|
|
69
69
|
for accessibility, all images should have descriptive alt text.
|