Skip to content

Commit 165e925

Browse files
author
Farzad Hayat
authored
DOC-2592: Update Accessibility Checker plugin page (#3534)
* Fix T4A rule description * DOC-2592: Add contentID property to API section * DOC-2592: Fix inline code inside admonitions * DOC-2592: Remove the `information` severity level * DOC-2592: Replace [object] with actual values in getReport() example * DOC-2592: Improve a11y_advanced_options admonition * DOC-2592: Improve a11ychecker_allow_decorative_images admonition * DOC-2592: Remove trailing comma * DOC-2592: Add "link" to contentID possible types
1 parent 223901c commit 165e925

File tree

5 files changed

+36
-18
lines changed

5 files changed

+36
-18
lines changed

modules/ROOT/pages/a11ychecker.adoc

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ The following checks are available for the {pluginname} plugin. The rules checke
4343

4444
Each rule has a severity level, which will be one of the following, listed in order of increasing severity:
4545

46-
* Information
4746
* Warning
4847
* Error
4948

@@ -264,7 +263,10 @@ WCAG 2.1 specification:: https://www.w3.org/WAI/WCAG21/Techniques/html/H39.html[
264263

265264
*Rule description:* this rule checks that all complex tables must have a `+summary+` attribute explaining to users of assistive technologies how to navigate through the data inside of the table.
266265

267-
NOTE: This rule only applies to HTML 4 content and is not checked when `+a11ychecker_html_version+` is set to `+html5+`.
266+
[NOTE]
267+
====
268+
This rule only applies to HTML 4 content and is not checked when `+a11ychecker_html_version+` is set to `+html5+`.
269+
====
268270

269271
==== {pluginname} rule details - T2
270272

@@ -281,7 +283,10 @@ WCAG 2.1 specification:: https://www.w3.org/WAI/WCAG21/Techniques/html/H73.html[
281283

282284
*Rule description:* this rule checks that the table caption and summary does not have the same text content. The caption should explain *what* the table is about while the summary should explain *how* to navigate the data inside of the table.
283285

284-
NOTE: The table `+summary+` attribute was deprecated in HTML 5, both the *what* and *how* information should be moved to the table caption.
286+
[NOTE]
287+
====
288+
The table `+summary+` attribute was deprecated in HTML 5, both the *what* and *how* information should be moved to the table caption.
289+
====
285290

286291
==== {pluginname} rule details - T3
287292

@@ -296,7 +301,7 @@ WCAG 2.1 specification:: https://www.w3.org/WAI/WCAG21/Techniques/html/H73.html[
296301
[[T4A]]
297302
=== T4A - Table markup
298303

299-
*Rule description:* this rule checks that all `+tables+` contain both `+td+` and `+th+` elements.
304+
*Rule description:* this rule checks that all `+tables+` contain both `+tr+` and `+td+` elements.
300305

301306
==== {pluginname} rule details - T4A
302307

@@ -380,7 +385,7 @@ Opens and closes the accessibility checker dialog with the results of the audit
380385

381386
[source,js]
382387
----
383-
editor.plugins.a11ychecker.toggleaudit();
388+
tinymce.activeEditor.plugins.a11ychecker.toggleaudit();
384389
----
385390

386391
[[getreport]]
@@ -396,38 +401,42 @@ const issues = tinymce.activeEditor.plugins.a11ychecker.getReport();
396401
397402
console.log(issues);
398403
399-
// example result
404+
// Example result
400405
[
401406
{
407+
"contentID": "<div id=\"accessibility-issue__contentID\"><span>Text:&nbsp;</span><span>\"H5\"</span></div>",
408+
"description": "Headings must be applied in sequential order. For example: Heading 1 should be followed by Heading 2, not Heading 3.",
409+
"element": h5, // reference to the DOM element where the issue was found
402410
"id": "D2",
403411
"severity": "error",
404-
"url": "http://www.w3.org/TR/UNDERSTANDING-WCAG20/content-structure-separation-programmatic.html",
405-
"description": "Headings must be applied in sequential order. For example: Heading 1 should be followed by Heading 2, not Heading 3.",
406-
"element": {} // The element value contains the DOM element (such as <h4>).
412+
"url": "https://www.w3.org/WAI/WCAG21/Techniques/general/G141.html",
407413
},
408414
{
415+
"contentID": "<div id=\"accessibility-issue__contentID\"><span>Table:&nbsp;</span><span>\"2x2\"</span></div>",
416+
"description": "Tables must have captions",
417+
"element": table, // reference to the DOM element where the issue was found
409418
"id": "T1",
410419
"severity": "error",
411-
"url": "http://www.w3.org/TR/UNDERSTANDING-WCAG20/content-structure-separation-programmatic.html",
412-
"description": "Tables must have captions",
413-
"element": {} // The element value contains the DOM element (such as <table>).
420+
"url": "https://www.w3.org/WAI/WCAG21/Techniques/html/H39.html",
414421
}
415422
]
416423
----
417424

418425
[[issue]]
419426
=== The `+issue+` object
420427

421-
In a11ychecker, when the content within the editor is `audited`, each element is checked to ensure that no xref:a11ychecker.adoc#accessibility-rules[Accessibility rules] are violated. Any element which doesnt adhere to a rule will generate an `issue` within the audit; the details of which are to be displayed in the a11ychecker dialog.
428+
In a11ychecker, when the content within the editor is `audited`, each element is checked to ensure that no xref:a11ychecker.adoc#accessibility-rules[Accessibility rules] are violated. Any element which doesn't adhere to a rule will generate an `issue` within the audit; the details of which are to be displayed in the a11ychecker dialog.
422429

423430
The `+'issue'+` object provides relevant data pertaining to any issue generated by an element which violates an xref:a11ychecker.adoc#accessibility-rules[Accessibility rule]:
424431

425432
* `+id+` : `+String+` A11ychecker issue identifier used by {productname}, such as D1, T4A. For a description and other details about the issue, see xref:accessibility-rules[Accessibility Rules].
426433

427434
* `+description+` : `+String+` description of the issue; as will be displayed in the dialog.
428435

429-
* `+severity+` : `+String+` severity level of the issue; either `+info+`, `+warning+` or `+error+`.
436+
* `+severity+` : `+String+` severity level of the issue; either `+warning+` or `+error+`.
430437

431438
* `+url+` : `+String+` URL reference for the issue. By default, this will be a link to the W3 website, containing the W3 WCAG technique that needs to be addressed to clear the issue.
432439

433440
* `+element+` : `+Object+` DOM element where the issue was found.
441+
442+
* `+contentID+` : `+String+` A short snippet of the content (such as text, link, image, or table) where the issue was found.

modules/ROOT/partials/configuration/a11y_advanced_options.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ Setting `+a11y_advanced_options+` to `+true+`:
1111
* Adds the *Image is decorative* option to the _Insert/Edit Image_ dialog, allowing users to specify that an image is decorative and does not require alternative text for accessibility purposes.
1212
* Adds the *Image is decorative* option to the _Accessibility Checker error_ dialog for images without alternative text or the `+role="presentation"+` attribute.
1313

14-
IMPORTANT: When `+a11y_advanced_options+` is set to `+true+`, xref:a11ychecker.adoc#a11ychecker_allow_decorative_images[`+a11ychecker_allow_decorative_images+`] will default to `+true+`.
14+
[IMPORTANT]
15+
====
16+
If `xref:a11ychecker.adoc#a11ychecker_allow_decorative_images[a11ychecker_allow_decorative_images]` is not explicitly set, the value defined in `+a11y_advanced_options+` will be used.
17+
====
1518

1619
*Type:* `+Boolean+`
1720

modules/ROOT/partials/configuration/a11ychecker_allow_decorative_images.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ If `+a11ychecker_allow_decorative_images+` is set to `+false+`, the Accessibilit
2525
* An image has an empty alternative text attribute.
2626
* An image has the `+role="presentation"+` attribute.
2727

28-
NOTE: If xref:a11ychecker.adoc#a11y_advanced_options[`+a11y_advanced_options+`] is set to `+true+`, `+a11ychecker_allow_decorative_images+` will default to `+true+`.
28+
[NOTE]
29+
====
30+
If `+a11ychecker_allow_decorative_images+` is not explicitly set, the value defined in `xref:a11ychecker.adoc#a11y_advanced_options[a11y_advanced_options]` will be used.
31+
====
2932

3033
*Type:* `+Boolean+`
3134

modules/ROOT/partials/configuration/a11ychecker_issue_url_callback.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[a11ychecker_issue_url_callback]]
22
== `+a11ychecker_issue_url_callback+`
33

4-
The `+a11ychecker_issue_url_callback+` option is used to change the target URL for the "Click for more info" button (image:icons/help.svg[help icon - a question mark inside a circle]) in the Accessibility Checker dialog. By default, the "more info" links will point to `+https://www.tiny.cloud/docs/tinymce/6/a11ychecker/#<ruleId>+`, such as `+https://www.tiny.cloud/docs/tinymce/6/a11ychecker/#D1+`. This option can be used to set the target URL to a page or pages outside {site-url}/.
4+
The `+a11ychecker_issue_url_callback+` option is used to change the target URL for the "Click for more info" button (image:icons/help.svg[help icon - a question mark inside a circle]) in the Accessibility Checker dialog. By default, the "more info" links will point to `+https://www.tiny.cloud/docs/tinymce/7/a11ychecker/#<ruleId>+`, such as `+https://www.tiny.cloud/docs/tinymce/7/a11ychecker/#D1+`. This option can be used to set the target URL to a page or pages outside {site-url}/.
55

66
*Type:* `+Function+`
77

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
NOTE: In {productname} 6.3 and later, rule xref:I3[I3] can also be applied. If applied, an _Image alternative text should be less than 100 characters_ warning dialog presents if the alternative (`+alt+`) text is longer than 100 characters. This dialog also presents the alternative text in an editable field, for immediate repair.
1+
[NOTE]
2+
====
3+
In {productname} 6.3 and later, rule xref:I3[I3] can also be applied. If applied, an _Image alternative text should be less than 100 characters_ warning dialog presents if the alternative (`+alt+`) text is longer than 100 characters. This dialog also presents the alternative text in an editable field, for immediate repair.
4+
====

0 commit comments

Comments
 (0)