markdowndocs 0.11.3 → 0.12.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee414b6e508ae906b792f1abd65e21135a1439cf740998f69a1ad7cde743f1c1
4
- data.tar.gz: 55f37cb07e8d2e274ca25fdc73e3448075fb945a7d10e852e596203893643190
3
+ metadata.gz: 41a46158462a10ecd9535da9ec2a29896d9482026175a6e692373f8795843dae
4
+ data.tar.gz: 9b1b4a4d5e378bcc619cdebb54a70fd1f067aaff9b2057e67a1003c48985c4f6
5
5
  SHA512:
6
- metadata.gz: e0a49a7d046d2539060dd9bb4cab2f4d9d626c58020a41c898ee8627ae11eb99e2c28a9ff336291acbfd72b3903405e101abac33152fa99e3f0c2a6806d3be00
7
- data.tar.gz: 8a7ef92900c9e99f9702838b7ab68cc619509c84cace45e1c0f86c94085154e546cc8dd4b94cfc89af9fcbaed6691db4722b556439405320f3fb33ceb00a9db1
6
+ metadata.gz: d601a0a4871b811365f4ea97ff130189fb64cfd311b5a1f977368c69217973988b4571c0d9fd16008250b29a741bc525989ae1b93b8b3dbc9b4e22365d1173da
7
+ data.tar.gz: 766ecc84e968992fd23112f762140440d252a54661434c0708f0ec590371de857caec902b6a32377541dc7b79d003e7ac5f2ca1aa7b6376c5e0f4ac6954fbd29
data/CHANGELOG.md CHANGED
@@ -5,6 +5,64 @@ 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
+ ## [Unreleased]
9
+
10
+ ## [0.12.0] - 2026-11-20
11
+
12
+ A security release. Host apps get patched HTML sanitization, and the gem drops
13
+ Ruby 3.2, which no longer receives security fixes. No API changes, but apps
14
+ still on Ruby 3.2 should stay on 0.11.x.
15
+
16
+ ### Removed
17
+
18
+ - **Ruby 3.2 is no longer supported.** `required_ruby_version` is now
19
+ `>= 3.3.0`. Ruby 3.2 reached end of life in March 2026 and no longer receives
20
+ security fixes. Apps still on 3.2 can stay on markdowndocs 0.11.x until they
21
+ upgrade Ruby.
22
+
23
+ ### Security
24
+
25
+ - **markdowndocs now requires rails-html-sanitizer 1.7.2 or later** (was
26
+ `~> 1.6`). The sanitizer is markdowndocs' main defence against unsafe HTML
27
+ in rendered docs, and 1.7.2 fixes a possible XSS through shared scrubber
28
+ state when several threads sanitize at once, which is the normal case under
29
+ a multi-threaded server like Puma. It also requires loofah 2.25.3, so host
30
+ apps pick up loofah's XSS fixes too. Run `bundle update markdowndocs` and
31
+ Bundler will upgrade both.
32
+
33
+ ### Changed
34
+
35
+ - CI now tests Ruby 3.3, 3.4 and 4.0, and the gem is linted and released on
36
+ Ruby 3.4 instead of 3.2.
37
+ - Development dependencies refreshed, including Rails 8.1.4.1 and
38
+ commonmarker 2.10.1. commonmarker 2.10 places the heading anchor after the
39
+ heading text instead of before it; rendered docs pages are unaffected
40
+ because `add_heading_anchors` assigns heading IDs itself and strips the
41
+ empty anchor links.
42
+
43
+ ## [0.11.4] - 2026-09-23
44
+
45
+ Two search fixes. Neither changes an API, but the second one asks something of
46
+ apps that have overridden the docs index template.
47
+
48
+ ### Fixed
49
+
50
+ - **A query typed before the search index arrives is no longer dropped.**
51
+ `performSearch` returns through `showAll()` while `miniSearch` is still null,
52
+ and nothing re-read the input once the fetch resolved — so on a slow
53
+ connection the filter looked dead to anyone who started typing straight away.
54
+ The controller now re-runs the search as soon as the index is usable. Proved
55
+ by a browser spec in a host app rather than here: this repo has no
56
+ JavaScript test harness, and standing one up is tracked separately.
57
+
58
+ - **The docs index filter no longer hides every card.** `search_index` keys each
59
+ entry on `path_slug`, but the index template tagged each card with the bare
60
+ `slug`, and `docs_search_controller` matches a card by comparing the two. A
61
+ mode-scoped document therefore never matched its own index entry, so any query
62
+ emptied the page. Cards now carry `path_slug`. Apps that copied
63
+ `docs/index.html.erb` into their own `app/views/markdowndocs/docs/` need the
64
+ same change locally — a gem upgrade does not reach an override.
65
+
8
66
  ## [0.11.3] - 2026-09-03
9
67
 
10
68
  ### Accessibility
data/README.md CHANGED
@@ -19,7 +19,7 @@ A drop-in mountable Rails engine that turns a folder of markdown files into a br
19
19
 
20
20
  ## Requirements
21
21
 
22
- - Ruby >= 3.2
22
+ - Ruby >= 3.3
23
23
  - Rails >= 7.1
24
24
 
25
25
  ## Installation
@@ -32,6 +32,12 @@ export default class extends Controller {
32
32
  }
33
33
  })
34
34
  this.miniSearch.addAll(docs)
35
+
36
+ // A query typed while the index was still loading was dropped:
37
+ // performSearch returns through showAll() while miniSearch is null, and
38
+ // nothing re-read the input once the fetch resolved, so the filter looked
39
+ // dead to anyone who started typing straight away (#42).
40
+ if (this.hasInputTarget && this.inputTarget.value.trim()) this.performSearch()
35
41
  } catch (e) {
36
42
  console.warn("Markdowndocs: failed to load search index", e)
37
43
  }
@@ -269,7 +269,7 @@ module Markdowndocs
269
269
  if Array(raw).map(&:to_s).sort == Markdowndocs.config.modes.sort
270
270
  "This doc is already declared multi-audience; remove the `audience:` key (root files are visible in every mode)."
271
271
  else
272
- modes = Array(raw).map(&:to_s).join(", ")
272
+ modes = Array(raw).join(", ")
273
273
  "This doc declares audience: [#{modes}]. Path-based routing supports only a single mode per file; either move the file to a single mode subdirectory or leave the file at root and remove `audience:` (root is shared)."
274
274
  end
275
275
  else
@@ -56,7 +56,12 @@
56
56
  md:grid-cols-2
57
57
  lg:grid-cols-3">
58
58
  <% docs.each do |doc| %>
59
- <div <% if @search_enabled %>data-docs-search-target="card" data-slug="<%= doc.slug %>"<% end %>>
59
+ <%# path_slug, NOT the bare slug: search_index keys every entry on
60
+ path_slug, and docs_search_controller matches a card by testing
61
+ this attribute against those ids. A mode-scoped document tagged
62
+ with its bare slug matches nothing, which hid every card on
63
+ every query (#40). %>
64
+ <div <% if @search_enabled %>data-docs-search-target="card" data-slug="<%= doc.path_slug %>"<% end %>>
60
65
  <%= render "markdowndocs/docs/card", doc: doc %>
61
66
  </div>
62
67
  <% end %>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Markdowndocs
4
- VERSION = "0.11.3"
4
+ VERSION = "0.12.0"
5
5
  end
data/mise.toml CHANGED
@@ -1,2 +1,2 @@
1
1
  [tools]
2
- ruby = "3.4.6"
2
+ ruby = "3.4.12"
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdowndocs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.3
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Chmura
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2026-09-04 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rails
@@ -58,14 +57,20 @@ dependencies:
58
57
  requirements:
59
58
  - - "~>"
60
59
  - !ruby/object:Gem::Version
61
- version: '1.6'
60
+ version: '1.7'
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 1.7.2
62
64
  type: :runtime
63
65
  prerelease: false
64
66
  version_requirements: !ruby/object:Gem::Requirement
65
67
  requirements:
66
68
  - - "~>"
67
69
  - !ruby/object:Gem::Version
68
- version: '1.6'
70
+ version: '1.7'
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 1.7.2
69
74
  description: Mountable Rails engine that renders markdown files as a browsable documentation
70
75
  site with syntax highlighting, TOC generation, category grouping, and mode-based
71
76
  content filtering.
@@ -75,7 +80,6 @@ executables: []
75
80
  extensions: []
76
81
  extra_rdoc_files: []
77
82
  files:
78
- - ".tool-versions"
79
83
  - CHANGELOG.md
80
84
  - README.md
81
85
  - Rakefile
@@ -115,7 +119,6 @@ metadata:
115
119
  homepage_uri: https://github.com/dschmura/markdowndocs
116
120
  source_code_uri: https://github.com/dschmura/markdowndocs
117
121
  changelog_uri: https://github.com/dschmura/markdowndocs/blob/main/CHANGELOG.md
118
- post_install_message:
119
122
  rdoc_options: []
120
123
  require_paths:
121
124
  - lib
@@ -123,15 +126,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
123
126
  requirements:
124
127
  - - ">="
125
128
  - !ruby/object:Gem::Version
126
- version: 3.2.0
129
+ version: 3.3.0
127
130
  required_rubygems_version: !ruby/object:Gem::Requirement
128
131
  requirements:
129
132
  - - ">="
130
133
  - !ruby/object:Gem::Version
131
134
  version: '0'
132
135
  requirements: []
133
- rubygems_version: 3.4.19
134
- signing_key:
136
+ rubygems_version: 3.6.9
135
137
  specification_version: 4
136
138
  summary: A drop-in markdown documentation site for Rails apps
137
139
  test_files: []
data/.tool-versions DELETED
@@ -1 +0,0 @@
1
- ruby 3.4.5