Skip to content

Commit 13b7e59

Browse files
authored
Add standard and best-practice options to axe (#14607) (#14682)
Add `standard` and `best-practice` options to `axe` The `axe` accessibility checker previously always ran axe-core's default rule set. These options let a document scope its accessibility scan to a WCAG conformance level and control whether axe's best-practice rules run. Behavior is unchanged when neither option is set. - `standard` — scope checks to a WCAG level (`wcag2a` … `wcag22aaa`), including rules axe-core keeps disabled by default for that level, such as AAA color contrast and `target-size` - `best-practice` — check or skip axe's best-practice rules, which are recommendations not required by any WCAG success criterion - Object-form `axe` options now default to `output: console`, so a bare `axe: {standard: …}` reports instead of silently doing nothing - `preload` is now passed as an `axe.run` option rather than on its context argument Fixes #14607.
1 parent b19d95b commit 13b7e59

14 files changed

Lines changed: 596 additions & 70 deletions

‎news/changelog-1.10.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ All changes included in 1.10:
1818
- ([#14468](https://github.com/quarto-dev/quarto-cli/issues/14468)): The `axe` accessibility report UI (HTML overlay, revealjs report slide, dashboard offcanvas) now uses its own theme-independent colors instead of inheriting from `brand` or theme. Keeps the report readable regardless of page styling, and stops `axe` from clobbering brand colors set via `_brand.yml`.
1919
- ([#14602](https://github.com/quarto-dev/quarto-cli/pull/14602), [#14632](https://github.com/quarto-dev/quarto-cli/pull/14632)): Fix ORCID profile link having no accessible name for screen readers in HTML, Reveal.js, and ipynb title-block author metadata. (author: @mcanouil for #14602)
2020
- ([#14604](https://github.com/quarto-dev/quarto-cli/issues/14604)): The `axe` accessibility report UI now shows each violation's WCAG conformance level (e.g. `WCAG 2.0 AA (1.4.3)`) or `Best Practice`, derived from the violation's axe-core tags.
21+
- ([#14607](https://github.com/quarto-dev/quarto-cli/issues/14607)): Add `standard` and `best-practice` options to `axe`. `standard` scopes accessibility checks to a WCAG conformance level (e.g. `standard: wcag21aa`), including the rules axe-core keeps off by default for that level (such as AAA color contrast); `best-practice` controls whether axe's best-practice rules (recommendations not required by any WCAG success criterion) are checked.
2122
- ([#14655](https://github.com/quarto-dev/quarto-cli/issues/14655)): Add accessible names to code line-number links so screen readers and accessibility audits no longer report them as empty links.
2223
- ([#14676](https://github.com/quarto-dev/quarto-cli/pull/14676)): The `axe` accessibility report UI now lists violations most-important-first: by impact (critical first), then WCAG conformance level (A before AA, current criteria before Best Practice and obsolete ones), then rule id. `output: json` still emits axe-core's raw, unsorted result.
2324
- ([#14677](https://github.com/quarto-dev/quarto-cli/pull/14677)): The `axe` option now uses a copy of axe-core bundled with Quarto instead of loading it from the Skypack CDN in the reader's browser. Accessibility checking now works offline, and viewing a rendered document no longer triggers a request to `cdn.skypack.dev`. The axe-core version is unchanged (4.10.3), so scan results are identical.

‎src/resources/editor/tools/vs-code.mjs‎

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21838,9 +21838,9 @@ var require_yaml_intelligence_resources = __commonJS({
2183821838
short: "Name that should be displayed for the overall site",
2183921839
long: "Name that should be displayed for the overall site. If not explicitly\nprovided in the <code>open-graph</code> metadata, Quarto will use the\nwebsite or book <code>title</code> by default."
2184021840
},
21841-
"Footer left content",
21842-
"Footer right content",
21843-
"Footer center content",
21841+
"Footer left content. Supports markdown formatting.",
21842+
"Footer right content. Supports markdown formatting.",
21843+
"Footer center content. Supports markdown formatting.",
2184421844
"Footer border (<code>true</code>, <code>false</code>, or a border\ncolor)",
2184521845
"Footer background color",
2184621846
"Footer foreground color",
@@ -21885,7 +21885,7 @@ var require_yaml_intelligence_resources = __commonJS({
2188521885
},
2188621886
"Path to a file containing the Plausible Analytics script snippet",
2188721887
"Provides an announcement displayed at the top of the page.",
21888-
"The content of the announcement",
21888+
"The content of the announcement. Supports markdown formatting.",
2188921889
"Whether this announcement may be dismissed by the user.",
2189021890
{
2189121891
short: "The icon to display in the announcement",
@@ -21943,7 +21943,7 @@ var require_yaml_intelligence_resources = __commonJS({
2194321943
"Field that contains the section of index entries",
2194421944
"Additional parameters to pass when executing a search",
2194521945
"Top navigation options",
21946-
"The navbar title. Uses the project title if none is specified.",
21946+
"The navbar title. Uses the project title if none is specified.\nSupports markdown formatting.",
2194721947
"Specification of image that will be displayed to the left of the\ntitle.",
2194821948
"Alternate text for the logo image.",
2194921949
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
@@ -21959,7 +21959,7 @@ var require_yaml_intelligence_resources = __commonJS({
2195921959
"Collapse tools into the navbar menu when the display becomes\nnarrow.",
2196021960
"Side navigation options",
2196121961
"The identifier for this sidebar.",
21962-
"The sidebar title. Uses the project title if none is specified.",
21962+
"The sidebar title. Uses the project title if none is specified.\nSupports markdown formatting.",
2196321963
"Specification of image that will be displayed in the sidebar.",
2196421964
"Alternate text for the logo image.",
2196521965
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
@@ -21976,7 +21976,7 @@ var require_yaml_intelligence_resources = __commonJS({
2197621976
"Markdown to place above sidebar content (text or file path)",
2197721977
"Markdown to place below sidebar content (text or file path)",
2197821978
"The identifier for this sidebar.",
21979-
"The sidebar title. Uses the project title if none is specified.",
21979+
"The sidebar title. Uses the project title if none is specified.\nSupports markdown formatting.",
2198021980
"Specification of image that will be displayed in the sidebar.",
2198121981
"Alternate text for the logo image.",
2198221982
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
@@ -22052,7 +22052,7 @@ var require_yaml_intelligence_resources = __commonJS({
2205222052
},
2205322053
"Path to a file containing the Plausible Analytics script snippet",
2205422054
"Provides an announcement displayed at the top of the page.",
22055-
"The content of the announcement",
22055+
"The content of the announcement. Supports markdown formatting.",
2205622056
"Whether this announcement may be dismissed by the user.",
2205722057
{
2205822058
short: "The icon to display in the announcement",
@@ -22110,7 +22110,7 @@ var require_yaml_intelligence_resources = __commonJS({
2211022110
"Field that contains the section of index entries",
2211122111
"Additional parameters to pass when executing a search",
2211222112
"Top navigation options",
22113-
"The navbar title. Uses the project title if none is specified.",
22113+
"The navbar title. Uses the project title if none is specified.\nSupports markdown formatting.",
2211422114
"Specification of image that will be displayed to the left of the\ntitle.",
2211522115
"Alternate text for the logo image.",
2211622116
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
@@ -22126,7 +22126,7 @@ var require_yaml_intelligence_resources = __commonJS({
2212622126
"Collapse tools into the navbar menu when the display becomes\nnarrow.",
2212722127
"Side navigation options",
2212822128
"The identifier for this sidebar.",
22129-
"The sidebar title. Uses the project title if none is specified.",
22129+
"The sidebar title. Uses the project title if none is specified.\nSupports markdown formatting.",
2213022130
"Specification of image that will be displayed in the sidebar.",
2213122131
"Alternate text for the logo image.",
2213222132
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
@@ -22143,7 +22143,7 @@ var require_yaml_intelligence_resources = __commonJS({
2214322143
"Markdown to place above sidebar content (text or file path)",
2214422144
"Markdown to place below sidebar content (text or file path)",
2214522145
"The identifier for this sidebar.",
22146-
"The sidebar title. Uses the project title if none is specified.",
22146+
"The sidebar title. Uses the project title if none is specified.\nSupports markdown formatting.",
2214722147
"Specification of image that will be displayed in the sidebar.",
2214822148
"Alternate text for the logo image.",
2214922149
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
@@ -24479,7 +24479,7 @@ var require_yaml_intelligence_resources = __commonJS({
2447924479
},
2448024480
"Path to a file containing the Plausible Analytics script snippet",
2448124481
"Provides an announcement displayed at the top of the page.",
24482-
"The content of the announcement",
24482+
"The content of the announcement. Supports markdown formatting.",
2448324483
"Whether this announcement may be dismissed by the user.",
2448424484
{
2448524485
short: "The icon to display in the announcement",
@@ -24537,7 +24537,7 @@ var require_yaml_intelligence_resources = __commonJS({
2453724537
"Field that contains the section of index entries",
2453824538
"Additional parameters to pass when executing a search",
2453924539
"Top navigation options",
24540-
"The navbar title. Uses the project title if none is specified.",
24540+
"The navbar title. Uses the project title if none is specified.\nSupports markdown formatting.",
2454124541
"Specification of image that will be displayed to the left of the\ntitle.",
2454224542
"Alternate text for the logo image.",
2454324543
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
@@ -24553,7 +24553,7 @@ var require_yaml_intelligence_resources = __commonJS({
2455324553
"Collapse tools into the navbar menu when the display becomes\nnarrow.",
2455424554
"Side navigation options",
2455524555
"The identifier for this sidebar.",
24556-
"The sidebar title. Uses the project title if none is specified.",
24556+
"The sidebar title. Uses the project title if none is specified.\nSupports markdown formatting.",
2455724557
"Specification of image that will be displayed in the sidebar.",
2455824558
"Alternate text for the logo image.",
2455924559
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
@@ -24570,7 +24570,7 @@ var require_yaml_intelligence_resources = __commonJS({
2457024570
"Markdown to place above sidebar content (text or file path)",
2457124571
"Markdown to place below sidebar content (text or file path)",
2457224572
"The identifier for this sidebar.",
24573-
"The sidebar title. Uses the project title if none is specified.",
24573+
"The sidebar title. Uses the project title if none is specified.\nSupports markdown formatting.",
2457424574
"Specification of image that will be displayed in the sidebar.",
2457524575
"Alternate text for the logo image.",
2457624576
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
@@ -24775,6 +24775,8 @@ var require_yaml_intelligence_resources = __commonJS({
2477524775
"List execution engines you want to give priority when determining\nwhich engine should render a notebook. If two engines have support for a\nnotebook, the one listed earlier will be chosen. Quarto\u2019s default order\nis \u2018knitr\u2019, \u2018jupyter\u2019, \u2018markdown\u2019, \u2018julia\u2019.",
2477624776
"When defined, run axe-core accessibility tests on the document.",
2477724777
"If set, output axe-core results on console. <code>json</code>:\nproduce structured output; <code>console</code>: print output to\njavascript console; <code>document</code>: produce a visual report of\nviolations in the document itself.",
24778+
"Only check the rules for this WCAG conformance level, named as\nversion then level (e.g.&nbsp;<code>wcag21aa</code> for WCAG 2.1 AA). Each\nlevel includes the levels and versions it builds on, and may check rules\naxe-core disables by default (such as AAA color contrast). Axe\u2019s\nbest-practice rules are excluded unless <code>best-practice: true</code>\nis also set.",
24779+
"Whether to check axe-core\u2019s best-practice rules (checks recommended\nby axe that aren\u2019t required by any WCAG success criterion). Checked by\ndefault when <code>standard</code> is unset; excluded by default when\n<code>standard</code> is set.",
2477824780
"The logo image.",
2477924781
{
2478024782
short: "Advanced geometry settings for Typst margin layout.",
@@ -24850,7 +24852,7 @@ var require_yaml_intelligence_resources = __commonJS({
2485024852
},
2485124853
"Path to a file containing the Plausible Analytics script snippet",
2485224854
"Provides an announcement displayed at the top of the page.",
24853-
"The content of the announcement",
24855+
"The content of the announcement. Supports markdown formatting.",
2485424856
"Whether this announcement may be dismissed by the user.",
2485524857
{
2485624858
short: "The icon to display in the announcement",
@@ -24908,7 +24910,7 @@ var require_yaml_intelligence_resources = __commonJS({
2490824910
"Field that contains the section of index entries",
2490924911
"Additional parameters to pass when executing a search",
2491024912
"Top navigation options",
24911-
"The navbar title. Uses the project title if none is specified.",
24913+
"The navbar title. Uses the project title if none is specified.\nSupports markdown formatting.",
2491224914
"Specification of image that will be displayed to the left of the\ntitle.",
2491324915
"Alternate text for the logo image.",
2491424916
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
@@ -24924,7 +24926,7 @@ var require_yaml_intelligence_resources = __commonJS({
2492424926
"Collapse tools into the navbar menu when the display becomes\nnarrow.",
2492524927
"Side navigation options",
2492624928
"The identifier for this sidebar.",
24927-
"The sidebar title. Uses the project title if none is specified.",
24929+
"The sidebar title. Uses the project title if none is specified.\nSupports markdown formatting.",
2492824930
"Specification of image that will be displayed in the sidebar.",
2492924931
"Alternate text for the logo image.",
2493024932
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
@@ -24941,7 +24943,7 @@ var require_yaml_intelligence_resources = __commonJS({
2494124943
"Markdown to place above sidebar content (text or file path)",
2494224944
"Markdown to place below sidebar content (text or file path)",
2494324945
"The identifier for this sidebar.",
24944-
"The sidebar title. Uses the project title if none is specified.",
24946+
"The sidebar title. Uses the project title if none is specified.\nSupports markdown formatting.",
2494524947
"Specification of image that will be displayed in the sidebar.",
2494624948
"Alternate text for the logo image.",
2494724949
"Target href from navbar logo / title. By default, the logo and title\nlink to the root page of the site (/index.html).",
@@ -25374,12 +25376,12 @@ var require_yaml_intelligence_resources = __commonJS({
2537425376
mermaid: "%%"
2537525377
},
2537625378
"handlers/mermaid/schema.yml": {
25377-
_internalId: 222617,
25379+
_internalId: 223022,
2537825380
type: "object",
2537925381
description: "be an object",
2538025382
properties: {
2538125383
"mermaid-format": {
25382-
_internalId: 222609,
25384+
_internalId: 223014,
2538325385
type: "enum",
2538425386
enum: [
2538525387
"png",
@@ -25395,7 +25397,7 @@ var require_yaml_intelligence_resources = __commonJS({
2539525397
exhaustiveCompletions: true
2539625398
},
2539725399
theme: {
25398-
_internalId: 222616,
25400+
_internalId: 223021,
2539925401
type: "anyOf",
2540025402
anyOf: [
2540125403
{
@@ -25457,6 +25459,25 @@ var require_yaml_intelligence_resources = __commonJS({
2545725459
"document"
2545825460
],
2545925461
description: "If set, output axe-core results on console. `json`: produce structured output; `console`: print output to javascript console; `document`: produce a visual report of violations in the document itself."
25462+
},
25463+
standard: {
25464+
enum: [
25465+
"wcag2a",
25466+
"wcag2aa",
25467+
"wcag2aaa",
25468+
"wcag21a",
25469+
"wcag21aa",
25470+
"wcag21aaa",
25471+
"wcag22a",
25472+
"wcag22aa",
25473+
"wcag22aaa"
25474+
],
25475+
description: "Only check the rules for this WCAG conformance level, named as version then level (e.g. `wcag21aa` for WCAG 2.1 AA). Each level includes the levels and versions it builds on, and may check rules axe-core disables by default (such as AAA color contrast). Axe's best-practice rules are excluded unless `best-practice: true` is also set."
25476+
},
25477+
"best-practice": {
25478+
boolean: {
25479+
description: "Whether to check axe-core's best-practice rules (checks recommended by axe that aren't required by any WCAG success criterion). Checked by default when `standard` is unset; excluded by default when `standard` is set."
25480+
}
2546025481
}
2546125482
}
2546225483
}

‎src/resources/editor/tools/yaml/all-schema-definitions.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)