markdowndocs 0.11.1 → 0.11.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb123f5ef96df8917be85966728453e124ae2f418acb7458a583c3d42254b068
4
- data.tar.gz: e672f4cf03ee6a4fbb37a5cd2d924be8fb903256de7834adf36bfcf4e8877541
3
+ metadata.gz: 28f9775decd9995a54bf22809d3ef0a27cb5c684e4aa068a42592f7723c7ebd8
4
+ data.tar.gz: 5f1b6adc6bd424e4ef1c872432d11c6d93ea5c18fe1cc25dd389deea7c1c3a5e
5
5
  SHA512:
6
- metadata.gz: 7a7f53ed3821883f3f858b50039a1ca03ba4bbfafdbf9302dedfb9a0c150ab1f25e198c3ca602e13cec493a469135bdc5b0fb28b9157182e1278409136928171
7
- data.tar.gz: 15f9aa8cda587f9239ec84290d2fb1e3f3d6cf28c9b208b33d6081af842a5ce15eb5dcfa2a131905f41a228a03d19ea1dacd97fb3e80d35aa4a79f722cf4795a
6
+ metadata.gz: aca1b149e1727df52bf8ab922291cf9148e0c70867098674e11e5d4d092c278c800bf96017267c43763e1e3b009f998a87ecd4ee7800514d5087770ee33c65b2
7
+ data.tar.gz: 3f06f7c533c897094139c6d7ea90484314a1a3531fd64c56a9e615896599057ebb2c6165a138d17ba0f85089c10f0e68e259cd6c004e7466035f4bbd225e24ab
data/CHANGELOG.md CHANGED
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.11.2] - 2026-07-15
9
+
10
+ ### Accessibility
11
+
12
+ - **Scrollable code blocks are keyboard-focusable.** Long lines make a `<pre>`
13
+ overflow horizontally via the host's CSS; a scrollable region that isn't
14
+ focusable strands keyboard-only users (WCAG 2.1.1; axe
15
+ `scrollable-region-focusable`). Every rendered code block now carries
16
+ `tabindex="0"`, mirroring the same fix already applied to wide tables in
17
+ 0.11.0. No `aria-label` is added — a `<pre>`'s own text is its accessible
18
+ name.
19
+
8
20
  ## [0.11.1] - 2026-07-13
9
21
 
10
22
  ### Accessibility (follow-up review)
@@ -85,10 +85,26 @@ module Markdowndocs
85
85
  end
86
86
 
87
87
  mark_tables_keyboard_accessible(doc)
88
+ mark_code_blocks_keyboard_accessible(doc)
88
89
 
89
90
  doc.to_html
90
91
  end
91
92
 
93
+ # A code block (<pre>) overflows horizontally on long lines and becomes
94
+ # scrollable via the host's CSS, which the engine does not control and
95
+ # cannot inspect at render time — the same keyboard-access gap as wide
96
+ # tables (WCAG 2.1.1; axe `scrollable-region-focusable`). `tabindex="0"`
97
+ # makes each <pre> focusable so a keyboard-only user can scroll it with
98
+ # the arrow keys. Unlike a <table> we add NO aria-label: a <pre>'s own
99
+ # text content is its accessible name, so the focus stop is announced
100
+ # with the code itself; a synthetic "Code block N" label would only add
101
+ # noise. Same trade-off as tables — every code block becomes a tab stop,
102
+ # not only the ones that actually overflow, because scroll state is
103
+ # unknowable without a browser and this is a static (JS-free) fix.
104
+ def mark_code_blocks_keyboard_accessible(doc)
105
+ doc.css("pre").each { |pre| pre["tabindex"] = "0" }
106
+ end
107
+
92
108
  # A wide GFM table overflows its column and becomes horizontally
93
109
  # scrollable — via the host's typography/prose CSS, which the engine
94
110
  # does not control and cannot inspect at render time. A scrollable
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Markdowndocs
4
- VERSION = "0.11.1"
4
+ VERSION = "0.11.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdowndocs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Chmura