@kinti/a11y-toolkit 5.26.0 → 5.27.0
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/README.md +1 -1
- package/a11y_toolkit/a11y.py +27 -4
- package/a11y_toolkit/a11yact.py +9 -1
- package/a11y_toolkit/a11yannotate.py +185 -0
- package/a11y_toolkit/a11yaudit.py +853 -193
- package/a11y_toolkit/a11ybadge.py +24 -17
- package/a11y_toolkit/a11ybudget.py +145 -1
- package/a11y_toolkit/a11ycorpus.py +58 -24
- package/a11y_toolkit/a11ycrit.py +110 -53
- package/a11y_toolkit/a11ydiff.py +104 -34
- package/a11y_toolkit/a11ydisprove.py +15 -8
- package/a11y_toolkit/a11ydocx.py +8 -6
- package/a11y_toolkit/a11ydom.py +425 -95
- package/a11y_toolkit/a11yen301549.py +53 -1
- package/a11y_toolkit/a11yengines.py +157 -0
- package/a11y_toolkit/a11yevidence.py +81 -33
- package/a11y_toolkit/a11yfix.py +131 -52
- package/a11y_toolkit/a11yinit.py +30 -5
- package/a11y_toolkit/a11yjourney.py +110 -4
- package/a11y_toolkit/a11yledger.py +119 -12
- package/a11y_toolkit/a11ylocate.py +247 -0
- package/a11y_toolkit/a11yopenacr.py +10 -3
- package/a11y_toolkit/a11ypatches.py +154 -0
- package/a11y_toolkit/a11ypatterns.py +344 -0
- package/a11y_toolkit/a11ypdf.py +109 -53
- package/a11y_toolkit/a11yrgaa.py +60 -0
- package/a11y_toolkit/a11yroute.py +34 -12
- package/a11y_toolkit/a11ysarif.py +45 -18
- package/a11y_toolkit/a11yscope.py +67 -15
- package/a11y_toolkit/a11yscroll.py +7 -5
- package/a11y_toolkit/a11ystatement.py +30 -6
- package/a11y_toolkit/a11ytrace.py +293 -0
- package/a11y_toolkit/a11yvalidate.py +21 -15
- package/a11y_toolkit/a11yvpat.py +34 -7
- package/a11y_toolkit/a11yvtt.py +22 -6
- package/a11y_toolkit/a11ywiz.py +121 -0
- package/a11y_toolkit/contrast.py +62 -24
- package/a11y_toolkit/locales/en.json +177 -20
- package/a11y_toolkit/locales/es.json +178 -21
- package/a11y_toolkit/rgaa.json +2661 -0
- package/a11y_toolkit/server.py +149 -50
- package/package.json +2 -2
- package/a11y_toolkit/a11yplan.py +0 -214
- package/a11y_toolkit/a11ywcagem.py +0 -237
|
@@ -42,9 +42,12 @@ def _recheck_static(url, findings, timeout=30, lang='en'):
|
|
|
42
42
|
h['status'] = 'confirmed'
|
|
43
43
|
else:
|
|
44
44
|
h['status'] = 'rejected'
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
_rj = ('la señal {s!r} ya no dispara al re-auditar — la página '
|
|
46
|
+
'puede haber cambiado, o el hallazgo era un falso positivo'
|
|
47
|
+
if lang == 'es' else
|
|
48
|
+
"signal {s!r} no longer fires on re-audit — the page may "
|
|
49
|
+
'have changed, or the finding was a false positive')
|
|
50
|
+
h['reject_reason'] = _rj.format(s=h.get('signal', '?'))
|
|
48
51
|
verified.append(h)
|
|
49
52
|
return verified, None
|
|
50
53
|
|
|
@@ -65,10 +68,14 @@ def _recheck_rendered(url, findings, timeout=45, lang='en'):
|
|
|
65
68
|
h['status'] = 'confirmed'
|
|
66
69
|
else:
|
|
67
70
|
h['status'] = 'rejected'
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
_rj = ('la señal {s!r} ya no dispara en la re-auditoría renderizada '
|
|
72
|
+
'— el elemento puede haber cambiado o arreglarse, o el primer '
|
|
73
|
+
'hallazgo era un falso positivo'
|
|
74
|
+
if lang == 'es' else
|
|
75
|
+
"signal {s!r} no longer fires in the rendered re-audit — the "
|
|
76
|
+
'element may have changed, been fixed, or the first finding '
|
|
77
|
+
'was a false positive')
|
|
78
|
+
h['reject_reason'] = _rj.format(s=h.get('signal', '?'))
|
|
72
79
|
verified.append(h)
|
|
73
80
|
return verified, None
|
|
74
81
|
|
|
@@ -91,7 +98,7 @@ def disprove(url, report=None, timeout=30, lang='en'):
|
|
|
91
98
|
# evidence. Honest path: not-rechecked per page, with the pointer to
|
|
92
99
|
# re-verify each page properly.
|
|
93
100
|
every_finding = []
|
|
94
|
-
for page in (report.get('
|
|
101
|
+
for page in (report.get('reports') or []): # 'pages' es un CONTEO, no una lista
|
|
95
102
|
for h in page.get('findings', []):
|
|
96
103
|
every_finding.append(dict(h, disprover_status='not-rechecked',
|
|
97
104
|
page=page.get('url', '')))
|
package/a11y_toolkit/a11ydocx.py
CHANGED
|
@@ -87,7 +87,10 @@ def docx_screen(path, lang='en'):
|
|
|
87
87
|
for para in re.findall(r'<w:p\b.*?</w:p>', body, re.S):
|
|
88
88
|
if 'w:val="Heading' in para:
|
|
89
89
|
continue
|
|
90
|
-
|
|
90
|
+
# bold real: <w:b> presente SIN val de apagado explícito (0/false)
|
|
91
|
+
# — `<w:b w:val="0"/>` es bold-OFF y no cuenta
|
|
92
|
+
has_bold = any(not re.search(r'w:val="(?:0|false)"', tag)
|
|
93
|
+
for tag in re.findall(r'<w:b\b[^>]*>', para))
|
|
91
94
|
m_sz = re.search(r'<w:sz w:val="(\d+)"', para)
|
|
92
95
|
large = bool(m_sz) and int(m_sz.group(1)) >= 28
|
|
93
96
|
text = ''.join(re.findall(r'<w:t[^>]*>([^<]*)</w:t>', para)).strip()
|
|
@@ -102,16 +105,15 @@ def docx_screen(path, lang='en'):
|
|
|
102
105
|
order = {'high': 0, 'medium': 1, 'low': 2}
|
|
103
106
|
findings.sort(key=lambda h: order[h['severity']])
|
|
104
107
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
- 5 * sum(1 for h in hs if h['severity'] == 'low'))
|
|
108
|
+
# misma puntuación que pdf/vtt: compute_score compartido (12/6/2) — los
|
|
109
|
+
# scores cross-mode son comparables
|
|
110
|
+
from .a11yaudit import compute_score
|
|
109
111
|
|
|
110
112
|
return {
|
|
111
113
|
'mode': 'docx', 'file': str(path).rsplit('/', 1)[-1],
|
|
112
114
|
'language': language, 'images': len(docprs),
|
|
113
115
|
'tables': n_tables, 'tables_with_header': n_tblheader,
|
|
114
|
-
'score':
|
|
116
|
+
'score': compute_score(findings),
|
|
115
117
|
'findings': findings,
|
|
116
118
|
'summary': {s2: sum(1 for h in findings if h['severity'] == s2)
|
|
117
119
|
for s2 in ('high', 'medium', 'low')},
|