@krautzource/sre-to-tree
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -5,2 +5,10 @@ # Changelog | ||
### [2.0.2](https://github.com/krautzource/sre-to-tree/compare/v2.0.1...v2.0.2) (2021-11-11) | ||
### Bug Fixes | ||
* add aria-hidden to all treeitems ([5ef4cb5](https://github.com/krautzource/sre-to-tree/commit/5ef4cb554e9fc4a9317a132ec90a2901b739c033)), closes [#27](https://github.com/krautzource/sre-to-tree/issues/27) | ||
* prevent empty aria-label ([f4f1182](https://github.com/krautzource/sre-to-tree/commit/f4f11821d7d56f7b4746434d9de2254e93e910d1)), closes [#26](https://github.com/krautzource/sre-to-tree/issues/26) | ||
### [2.0.1](https://github.com/krautzource/sre-to-tree/compare/v2.0.0...v2.0.1) (2021-04-12) | ||
@@ -7,0 +15,0 @@ |
@@ -14,2 +14,3 @@ /** | ||
speech += node.getAttribute('data-semantic-speech'); | ||
if (speech === '') speech = 'blank'; | ||
node.setAttribute('aria-label', speech); | ||
@@ -22,2 +23,3 @@ if (node.getAttribute('data-semantic-braille')) | ||
node.setAttribute('role', 'treeitem'); | ||
node.setAttribute('aria-hidden', 'true'); | ||
}; | ||
@@ -132,2 +134,3 @@ | ||
moveAttribute(skeletonNode, node, 'aria-level'); | ||
skeletonNode.removeAttribute('aria-hidden'); | ||
skeletonNode.setAttribute('role', 'presentation'); | ||
@@ -134,0 +137,0 @@ } |
{ | ||
"name": "@krautzource/sre-to-tree", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Rewritig speech-rule-engine enriched DOM nodes to a labeled WAI ARIA tree", | ||
@@ -28,7 +28,7 @@ "main": "lib.js", | ||
"devDependencies": { | ||
"jsdom": "^16.4.0", | ||
"mathjax-full": "^3.1.2", | ||
"speech-rule-engine": "^3.2.0-beta.4", | ||
"standard-version": "^9.1.1", | ||
"tape": "^5.2.0" | ||
"jsdom": "^18.0.1", | ||
"mathjax-full": "^3.2.0", | ||
"speech-rule-engine": "^4.0.0-beta.2", | ||
"standard-version": "^9.3.2", | ||
"tape": "^5.3.1" | ||
}, | ||
@@ -35,0 +35,0 @@ "publishConfig": { |
@@ -6,3 +6,3 @@ const test = require('tape'); | ||
test('a first few tests', (t) => { | ||
t.plan(5); | ||
t.plan(6); | ||
const out = tex2svg('f(x) = y'); | ||
@@ -17,2 +17,3 @@ const svg = out.firstElementChild; | ||
t.ok(svg.getAttribute('aria-label'), 'Root gets non-emtpy data-owns'); | ||
t.deepEqual(svg.querySelectorAll('[role="treeitem"]'), svg.querySelectorAll('[aria-hidden="true"]') , 'All treeitems are aria-hidden'); | ||
}); |
@@ -9,3 +9,3 @@ const test = require('tape'); | ||
const dom = new JSDOM( | ||
`<!DOCTYPE html><p>Hello world</p><div> <span data-semantic-speech="" data-semantic-owns="2"></span</div>` | ||
`<!DOCTYPE html><p>Hello world</p><div> <span data-semantic-speech="bla" data-semantic-owns="2"></span</div>` | ||
); | ||
@@ -17,3 +17,3 @@ const p = dom.window.document.querySelector('p'); | ||
t.equal(processedDiv.getAttribute('data-owns'), '', 'Graceful failure with unexpected markup: cut off tree'); | ||
t.equal(processedDiv.getAttribute('aria-label'), '', 'Graceful failure with unexpected markup: label intact'); | ||
t.equal(processedDiv.getAttribute('aria-label'), 'bla', 'Graceful failure with unexpected markup: label intact'); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
0
21410
15
311