yard-fence 0.9.1 → 0.9.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: ab3ca14a888fee4e99027bbc6829dadd0d0cd566b177ff224859989ab88314cb
4
- data.tar.gz: 97cdc3cb1142a08e97b810984670625b774748b90540fefc0c7dc6cf2a0454ea
3
+ metadata.gz: 592d30a22117c36ce4540f48dda1c6c712db78503fab52030ee0e5c628858397
4
+ data.tar.gz: fa9a285483a488d420916ec7032e9a0b6687ca881eec942a44c150746c99997e
5
5
  SHA512:
6
- metadata.gz: 97dbc45ee58bdf782f39e55d89061dea5a5bdb8c8ba352abfa1c229329ac142dc05fb2c1ed640af1e4311358783945490f79008c4c5e4bc15e4179eee78864b6
7
- data.tar.gz: fbb5fdffb91d7097977467ea8d6d622c3cca6a7c8113016bd3b2d7cbe9f3d312209e960217fa87b13674b621f905af383e72cf4cb42103543742b09a1dd6b411
6
+ metadata.gz: c139823c9d34f991b55595749f8de0208580040b3b8607dfc5c0405dc65f0fab4822c4cca602dc53bf1e637480594c783a4b891757b7994bb6892a08042d7f4f
7
+ data.tar.gz: c948d805490ecebb7b98e8d7225931aba11092d5b80e3b7d95e9bc0da0ae8d8a89c144175ca5f5d6c7f84505201996706823c8d104e63cdc31beedd38ba8762d
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,17 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [0.9.2] - 2026-06-03
34
+
35
+ - TAG: [v0.9.2][0.9.2t]
36
+ - COVERAGE: 95.57% -- 194/203 lines in 5 files
37
+ - BRANCH COVERAGE: 82.81% -- 53/64 branches in 5 files
38
+ - 39.13% documented
39
+
40
+ ### Fixed
41
+
42
+ - Prevented YARD from treating pipe-delimited token examples such as `{KJ|GEM_NAME}` and rendered example-table fragments as unresolved documentation links.
43
+
33
44
  ## [0.9.1] - 2026-05-24
34
45
 
35
46
  - TAG: [v0.9.1][0.9.1t]
@@ -223,7 +234,9 @@ Please file a bug if you notice a violation of semantic versioning.
223
234
 
224
235
  - Initial release
225
236
 
226
- [Unreleased]: https://github.com/galtzo-floss/yard-fence/compare/v0.9.1...HEAD
237
+ [Unreleased]: https://github.com/galtzo-floss/yard-fence/compare/v0.9.2...HEAD
238
+ [0.9.2]: https://github.com/galtzo-floss/yard-fence/compare/v0.9.1...v0.9.2
239
+ [0.9.2t]: https://github.com/galtzo-floss/yard-fence/releases/tag/v0.9.2
227
240
  [0.9.1]: https://github.com/galtzo-floss/yard-fence/compare/v0.9.0...v0.9.1
228
241
  [0.9.1t]: https://github.com/galtzo-floss/yard-fence/releases/tag/v0.9.1
229
242
  [0.9.0]: https://github.com/galtzo-floss/yard-fence/compare/v0.8.2...v0.9.0
data/CONTRIBUTING.md CHANGED
@@ -50,6 +50,22 @@ There are many Rake tasks available as well. You can see them by running:
50
50
  bin/rake -T
51
51
  ```
52
52
 
53
+ ## Code quality checks
54
+
55
+ Run the Reek task when you want a smell check that fails on current findings:
56
+
57
+ ```shell
58
+ bin/rake reek
59
+ ```
60
+
61
+ Refresh the checked-in `REEK` backlog through the rake task, not by redirecting
62
+ the raw `reek` executable output. The rake task uses the project bundle and
63
+ avoids stale generated binstubs shadowing the Reek gem executable:
64
+
65
+ ```shell
66
+ bin/rake reek:update
67
+ ```
68
+
53
69
  ## Environment Variables for Local Development
54
70
 
55
71
  Below are the primary environment variables recognized by stone_checksums (and its integrated tools). Unless otherwise noted, set boolean values to the string "true" to enable.
@@ -86,11 +102,32 @@ Git hooks and commit message helpers (exe/kettle-commit-msg)
86
102
  - GIT_HOOK_FOOTER_SENTINEL: Required when footer append is enabled — a unique first-line sentinel to prevent duplicates
87
103
  - GIT_HOOK_FOOTER_APPEND_DEBUG: Extra debug output in the footer template (true/false)
88
104
 
105
+ Git diff driver setup
106
+ - Local setup writes repository `.gitattributes` entries and local Git `diff.smorg-*` command config so this checkout uses StructuredMerge semantic diffs.
107
+ - Global setup registers `diff.smorg-*` commands once in the user Git config; use it when you work across several StructuredMerge-enabled repositories.
108
+ - Include-file setup writes `.git/smorg/config` and includes it from local Git config, keeping command registrations out of the repository files.
109
+ - Git hosting forges generally ignore external diff drivers, so pull request views may still show raw textual diffs even when local `git diff` uses semantic drivers.
110
+
111
+ ```console
112
+ K_JEM_TEMPLATING=true bundle exec kettle-jem install
113
+ ```
114
+
115
+ Troubleshooting Git diffs
116
+ - Use `git diff --no-ext-diff` to compare against Git's built-in diff output.
117
+ - Use `git diff --no-textconv` when a textconv projection obscures the raw file bytes you need to inspect.
118
+ - If Git reports a missing `smorg-*` executable, rerun `bundle install` and the setup command above, then check `git config --local --get-regexp '^diff\.smorg-'`.
119
+ - To remove managed local entries, run `K_JEM_TEMPLATING=true bundle exec kettle-jem install --undo`; remove global command registrations with `git config --global --unset-all diff.smorg-ruby.command`.
120
+
89
121
  For a quick starting point, this repository’s `mise.toml` defines the shared defaults, and `.env.local` can override them locally. Copy `.env.local.example` to `.env.local`, use `KEY=value` lines, and either activate `mise` in your shell or run commands through `mise exec -C /path/to/project -- ...`.
90
122
 
91
123
  ## Appraisals
92
124
 
93
125
  From time to time the [appraisal2][🚎appraisal2] gemfiles in `gemfiles/` will need to be updated.
126
+ Generated appraisal and CI workflow floors are controlled by `ruby.test_minimum`
127
+ in `.structuredmerge/kettle-jem.yml`; this project was templated with `ruby.test_minimum: 3.2.0`.
128
+ That value describes the lowest Ruby version expected to run the test/development
129
+ toolchain, and it may be higher than the gemspec runtime floor.
130
+
94
131
  They are created and updated with the commands:
95
132
 
96
133
  ```console
data/README.md CHANGED
@@ -1,17 +1,10 @@
1
- [![Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0][🖼️galtzo-floss-i]][🖼️galtzo-floss] [![ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5][🖼️ruby-lang-i]][🖼️ruby-lang] [![yard-fence Logo by Aboling0, CC BY-SA 4.0][🖼️galtzo-floss-yard-fence-i]][🖼️galtzo-floss-yard-fence]
2
-
3
- [🖼️galtzo-floss-i]: https://logos.galtzo.com/assets/images/galtzo-floss/avatar-192px.svg
4
- [🖼️galtzo-floss]: https://discord.gg/3qme4XHNKN
5
- [🖼️ruby-lang-i]: https://logos.galtzo.com/assets/images/ruby-lang/avatar-192px.svg
6
- [🖼️ruby-lang]: https://www.ruby-lang.org/
7
- [🖼️galtzo-floss-yard-fence-i]: https://logos.galtzo.com/assets/images/galtzo-floss/yard-fence/avatar-192px.svg
8
- [🖼️galtzo-floss-yard-fence]: https://github.com/galtzo-floss/yard-fence
1
+ <a href="https://github.com/galtzo-floss"><img alt="galtzo-floss Logo by Aboling0, CC BY-SA 4.0" src="https://logos.galtzo.com/assets/images/galtzo-floss/avatar-128px.svg" width="12%" align="right"/></a> <a href="https://github.com/galtzo-floss/yard-fence"><img alt="yard-fence Logo by Aboling0, CC BY-SA 4.0" src="https://logos.galtzo.com/assets/images/galtzo-floss/yard-fence/avatar-128px.svg" width="12%" align="right"/></a>
9
2
 
10
3
  # 🍲 Yard::Fence
11
4
 
12
- [![Version][👽versioni]][👽version] [![GitHub tag (latest SemVer)][⛳️tag-img]][⛳️tag] [![License: MIT][📄license-img]][📄license] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![CodeCov Test Coverage][🏀codecovi]][🏀codecov] [![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls] [![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov] [![QLTY Maintainability][🏀qlty-mnti]][🏀qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf] [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf] [![Deps Locked][🚎13-🔒️-wfi]][🚎13-🔒️-wf] [![Deps Unlocked][🚎14-🔓️-wfi]][🚎14-🔓️-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![CodeQL][🖐codeQL-img]][🖐codeQL] [![Apache SkyWalking Eyes License Compatibility Check][🚎15-🪪-wfi]][🚎15-🪪-wf]
5
+ [![Version][👽versioni]][👽version] [![GitHub tag (latest SemVer)][⛳️tag-img]][⛳️tag] [![License: MIT][📄license-img]][📄license] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![CodeCov Test Coverage][🏀codecovi]][🏀codecov] [![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls] [![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov] [![QLTY Maintainability][🏀qlty-mnti]][🏀qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf] [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf] [![Deps Locked][🚎13-🔒️-wfi]][🚎13-🔒️-wf] [![Deps Unlocked][🚎14-🔓️-wfi]][🚎14-🔓️-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![Apache SkyWalking Eyes License Compatibility Check][🚎15-🪪-wfi]][🚎15-🪪-wf]
13
6
 
14
- `if ci_badges.map(&:color).detect { it != "green"}` ☝️ [let me know][🖼️galtzo-floss], as I may have missed the [discord notification][🖼️galtzo-floss].
7
+ `if ci_badges.map(&:color).detect { it != "green"}` ☝️ [let me know][✉️discord-invite], as I may have missed the [discord notification][✉️discord-invite].
15
8
 
16
9
  ---
17
10
 
@@ -26,7 +19,7 @@ I've summarized my thoughts in [this blog post](https://dev.to/galtzo/hostile-ta
26
19
 
27
20
  </details>
28
21
 
29
- ## 🌻 Synopsis
22
+ ## 🌻 Synopsis <a href="https://discord.gg/3qme4XHNKN"><img alt="Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0" src="https://logos.galtzo.com/assets/images/galtzo-floss/avatar-128px.svg" width="8%" align="right"/></a> <a href="https://ruby-toolbox.com"><img alt="ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5" src="https://logos.galtzo.com/assets/images/ruby-lang/avatar-128px.svg" width="8%" align="right"/></a>
30
23
 
31
24
  A brace converter for the markdown fences in your YARD docs to prevent the `InvalidLink` warning.
32
25
 
@@ -75,13 +68,15 @@ See the configuration and usage sections for more details.
75
68
  ### Compatibility
76
69
 
77
70
  Compatible with MRI Ruby 3.2.0+, and concordant releases of JRuby, and TruffleRuby.
71
+ CI workflows and Appraisals are generated for MRI Ruby 3.2.0+.
72
+ This test floor is configured by `ruby.test_minimum` in `.kettle-jem.yml` and
73
+ may be higher than the gem's runtime compatibility floor when legacy Rubies are
74
+ not practical for the current toolchain.
78
75
 
79
76
  | 🚚 _Amazing_ test matrix was brought to you by | 🔎 appraisal2 🔎 and the color 💚 green 💚 |
80
77
  |------------------------------------------------|--------------------------------------------------------|
81
78
  | 👟 Check it out! | ✨ [github.com/appraisal-rb/appraisal2][💎appraisal2] ✨ |
82
79
 
83
-
84
-
85
80
  ### Federated DVCS
86
81
 
87
82
  <details markdown="1">
@@ -382,6 +377,8 @@ To say "thanks!" ☝️ Join the Discord or 👇️ send money.
382
377
 
383
378
  ### Please give the project a star ⭐ ♥.
384
379
 
380
+ Many parts of this project are actively managed by a [kettle-jem](https://github.com/structuredmerge/structuredmerge-ruby/tree/main/gems/kettle-jem) smart template utilizing [StructuredMerge.org](https://structuredmerge.org) merge contracts.
381
+
385
382
  Thanks for RTFM. ☺️
386
383
 
387
384
  [⛳liberapay-img]: https://img.shields.io/liberapay/goal/pboling.svg?logo=liberapay&color=a51611&style=flat
@@ -484,8 +481,6 @@ Thanks for RTFM. ☺️
484
481
  [🏀codecovi]: https://codecov.io/gh/galtzo-floss/yard-fence/graph/badge.svg
485
482
  [🏀coveralls]: https://coveralls.io/github/galtzo-floss/yard-fence?branch=main
486
483
  [🏀coveralls-img]: https://coveralls.io/repos/github/galtzo-floss/yard-fence/badge.svg?branch=main
487
- [🖐codeQL]: https://github.com/galtzo-floss/yard-fence/security/code-scanning
488
- [🖐codeQL-img]: https://github.com/galtzo-floss/yard-fence/actions/workflows/codeql-analysis.yml/badge.svg
489
484
  [🚎ruby-3.2-wf]: https://github.com/galtzo-floss/yard-fence/actions/workflows/ruby-3.2.yml
490
485
  [🚎ruby-3.3-wf]: https://github.com/galtzo-floss/yard-fence/actions/workflows/ruby-3.3.yml
491
486
  [🚎ruby-3.4-wf]: https://github.com/galtzo-floss/yard-fence/actions/workflows/ruby-3.4.yml
@@ -530,7 +525,7 @@ Thanks for RTFM. ☺️
530
525
  [🤝cb-pulls]: https://codeberg.org/galtzo-floss/yard-fence/pulls
531
526
  [🤝cb-donate]: https://donate.codeberg.org/
532
527
  [🤝contributing]: https://github.com/galtzo-floss/yard-fence/blob/main/CONTRIBUTING.md
533
- [🏀codecov-g]: https://codecov.io/gh/galtzo-floss/yard-fence/graphs/tree.svg
528
+ [🏀codecov-g]: https://codecov.io/gh/galtzo-floss/yard-fence/graph/badge.svg
534
529
  [🖐contrib-rocks]: https://contrib.rocks
535
530
  [🖐contributors]: https://github.com/galtzo-floss/yard-fence/graphs/contributors
536
531
  [🖐contributors-img]: https://contrib.rocks/image?repo=galtzo-floss/yard-fence
@@ -548,7 +543,7 @@ Thanks for RTFM. ☺️
548
543
  [📌gitmoji]: https://gitmoji.dev
549
544
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
550
545
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
551
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.175-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
546
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.203-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
552
547
  [🔐security]: https://github.com/galtzo-floss/yard-fence/blob/main/SECURITY.md
553
548
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
554
549
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -557,6 +552,7 @@ Thanks for RTFM. ☺️
557
552
  [📄license-img]: https://img.shields.io/badge/License-MIT-259D6C.svg
558
553
  [📄license-compat]: https://www.apache.org/legal/resolved.html#category-a
559
554
  [📄license-compat-img]: https://img.shields.io/badge/Apache_Compatible:_Category_A-✓-259D6C.svg?style=flat&logo=Apache
555
+
560
556
  [📄ilo-declaration]: https://www.ilo.org/declaration/lang--en/index.htm
561
557
  [📄ilo-declaration-img]: https://img.shields.io/badge/ILO_Fundamental_Principles-✓-259D6C.svg?style=flat
562
558
  [🚎yard-current]: http://rubydoc.info/gems/yard-fence
@@ -575,7 +571,7 @@ Thanks for RTFM. ☺️
575
571
  | Package | yard-fence |
576
572
  | Description | 🍲 Convert ASCII braces ('{}') to full-width braces ('{}') within code fences (triple-or-single backticks) during YARD processing, and back to ASCII braces afterward |
577
573
  | Homepage | https://github.com/galtzo-floss/yard-fence |
578
- | Source | https://github.com/galtzo-floss/yard-fence/tree/v0.9.0 |
574
+ | Source | https://github.com/galtzo-floss/yard-fence/tree/v0.9.1 |
579
575
  | License | `MIT` |
580
576
  | Funding | https://github.com/sponsors/pboling, https://issuehunt.io/u/pboling, https://ko-fi.com/pboling, https://liberapay.com/pboling/donate, https://opencollective.com/galtzo-floss, https://patreon.com/galtzo, https://polar.sh/pboling, https://thanks.dev/u/gh/pboling, https://tidelift.com/funding/github/rubygems/yard-fence, https://www.buymeacoffee.com/pboling |
581
577
  <!-- kettle-jem:metadata:end -->
data/SECURITY.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  | Version | Supported |
6
6
  |----------|-----------|
7
- | 1.latest | ✅ |
7
+ | 0.latest | ✅ |
8
8
 
9
9
  ## Security contact information
10
10
 
@@ -18,4 +18,5 @@ else
18
18
  else
19
19
  warn("[yard/fence/hoist] Yard::Fence.use_kramdown_gfm! not available; skipping")
20
20
  end
21
+ Yard::Fence.install_html_helper_patch! if defined?(Yard::Fence) && Yard::Fence.respond_to?(:install_html_helper_patch!)
21
22
  end
@@ -26,7 +26,7 @@ module Yard
26
26
  def initialize(source, options = {})
27
27
  options[:input] = "GFM" unless options.key?(:input)
28
28
  @__yard_fence_source = source # Keep original for potential fallback.
29
- super(source, options)
29
+ super
30
30
  end
31
31
 
32
32
  # Override to_html to provide a smart fallback: if the GFM parse leaves literal
@@ -3,7 +3,7 @@
3
3
  module Yard
4
4
  module Fence
5
5
  module Version
6
- VERSION = "0.9.1"
6
+ VERSION = "0.9.2"
7
7
  end
8
8
  VERSION = Version::VERSION # Traditional Constant Location
9
9
  end
data/lib/yard/fence.rb CHANGED
@@ -73,7 +73,9 @@ module Yard
73
73
  TRIPLE_TICK_FENCE = /^\s*```/
74
74
  INLINE_TICK_FENCE = /`([^`]+)`/
75
75
  DOUBLE_BRACE_PLACEHOLDER_REGEX = /{{([^{}]+)}}/
76
- SINGLE_BRACE_PLACEHOLDER_REGEX = /{([A-Za-z0-9_:\-]+)}/
76
+ SINGLE_BRACE_PLACEHOLDER_REGEX = /{([A-Za-z0-9_:-]+)}/
77
+ BRACED_TOKEN_REFERENCE_REGEX = /{([^{}]*(?:\\?\|)[^{}]*)}/
78
+ BRACED_HTML_FRAGMENT_REGEX = /{([^{}]*<\/?[A-Za-z][^{}]*)}/
77
79
  # Lines that are part of a classic indented code block (CommonMark: 4 spaces)
78
80
  INDENTED_CODE_LINE = /^ {4,}\S/
79
81
 
@@ -131,6 +133,16 @@ module Yard
131
133
  end
132
134
  end
133
135
 
136
+ def sanitize_prose_braces(line)
137
+ ln = sanitize_inline_code(line)
138
+ # IMPORTANT: handle double-brace placeholders first so we don't partially
139
+ # convert the inner {TOKEN} and leave outer ASCII braces from `{{TOKEN}}`.
140
+ ln = ln.gsub(DOUBLE_BRACE_PLACEHOLDER_REGEX) { |m| fullwidth_braces(m) }
141
+ ln = ln.gsub(BRACED_TOKEN_REFERENCE_REGEX) { |m| fullwidth_braces(m) }
142
+ ln = ln.gsub(BRACED_HTML_FRAGMENT_REGEX) { |m| fullwidth_braces(m) }
143
+ ln.gsub(SINGLE_BRACE_PLACEHOLDER_REGEX) { |m| fullwidth_braces(m) }
144
+ end
145
+
134
146
  # Walk the text, toggling a simple in_fence state on ``` lines.
135
147
  # While inside a fence, convert braces to fullwidth; outside, also sanitize inline code
136
148
  # and disarm simple prose placeholders like {issuer} or {{something}}.
@@ -151,9 +163,7 @@ module Yard
151
163
  if line.strip.empty? || !line.match?(INDENTED_CODE_LINE)
152
164
  in_indented_block = false
153
165
  # Process this line as normal prose outside block
154
- ln = sanitize_inline_code(line)
155
- ln = ln.gsub(DOUBLE_BRACE_PLACEHOLDER_REGEX) { |m| fullwidth_braces(m) }
156
- ln.gsub(SINGLE_BRACE_PLACEHOLDER_REGEX) { |m| fullwidth_braces(m) }
166
+ sanitize_prose_braces(line)
157
167
  else
158
168
  fullwidth_braces(line)
159
169
  end
@@ -162,11 +172,7 @@ module Yard
162
172
  in_indented_block = true
163
173
  fullwidth_braces(line)
164
174
  else
165
- ln = sanitize_inline_code(line)
166
- # IMPORTANT: handle double-brace placeholders first so we don't partially
167
- # convert the inner {TOKEN} and leave outer ASCII braces from `{{TOKEN}}`.
168
- ln = ln.gsub(DOUBLE_BRACE_PLACEHOLDER_REGEX) { |m| fullwidth_braces(m) }
169
- ln.gsub(SINGLE_BRACE_PLACEHOLDER_REGEX) { |m| fullwidth_braces(m) }
175
+ sanitize_prose_braces(line)
170
176
  end
171
177
  end.join
172
178
  end
@@ -205,6 +211,10 @@ module Yard
205
211
  File.write(html_filepath, restored)
206
212
  end
207
213
 
214
+ def restore_ascii_braces(text)
215
+ text.tr(FULLWIDTH_BRACES, ASCII_BRACES)
216
+ end
217
+
208
218
  def postprocess_html_docs
209
219
  if ENV.fetch("YARD_FENCE_DISABLE", "false").casecmp?("true")
210
220
  # :nocov:
@@ -247,6 +257,43 @@ module Yard
247
257
  false
248
258
  end
249
259
 
260
+ module HtmlHelperPatch
261
+ def resolve_links(text)
262
+ protected_text = ::Yard::Fence.sanitize_prose_braces(text.to_s)
263
+ ::Yard::Fence.restore_ascii_braces(super(protected_text))
264
+ end
265
+ end
266
+
267
+ HTML_HELPER_TEMPLATE_PATCH = proc do |options|
268
+ HtmlHelperPatch if options.format == :html
269
+ end
270
+
271
+ def install_html_helper_patch!
272
+ begin
273
+ require "yard" unless defined?(::YARD::Templates::Template)
274
+ require "yard/templates/helpers/html_helper" unless defined?(::YARD::Templates::Helpers::HtmlHelper)
275
+ rescue LoadError, NameError => e
276
+ warn("Yard::Fence.install_html_helper_patch!: failed to load YARD HTML helper: #{e.class}: #{e.message}")
277
+ return false
278
+ end
279
+
280
+ extra_includes = ::YARD::Templates::Template.extra_includes
281
+ extra_includes << HTML_HELPER_TEMPLATE_PATCH unless extra_includes.include?(HTML_HELPER_TEMPLATE_PATCH)
282
+
283
+ helper = ::YARD::Templates::Helpers::HtmlHelper
284
+ return true if helper.method_defined?(:yard_fence_unprotected_resolve_links)
285
+
286
+ helper.module_eval do
287
+ alias_method(:yard_fence_unprotected_resolve_links, :resolve_links)
288
+
289
+ def resolve_links(text)
290
+ protected_text = ::Yard::Fence.sanitize_prose_braces(text.to_s)
291
+ ::Yard::Fence.restore_ascii_braces(yard_fence_unprotected_resolve_links(protected_text))
292
+ end
293
+ end
294
+ true
295
+ end
296
+
250
297
  # Clear the docs output directory to remove stale generated files.
251
298
  # Only runs when YARD_FENCE_CLEAN_DOCS=true is set.
252
299
  # This ensures that if a markdown file is deleted from the project,
@@ -301,3 +348,4 @@ end
301
348
  # Rake integration is explicit. Call Yard::Fence.install_rake_tasks! from your
302
349
  # Rakefile after defining the :yard task so prepare + postprocess only run for
303
350
  # documentation builds, never for unrelated processes that happen to load YARD.
351
+ Yard::Fence.install_html_helper_patch!
@@ -6,4 +6,3 @@ module Yard
6
6
  VERSION: String
7
7
  end
8
8
  end
9
-
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard-fence
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -104,6 +104,9 @@ dependencies:
104
104
  - - "~>"
105
105
  - !ruby/object:Gem::Version
106
106
  version: '2.0'
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: 2.0.8
107
110
  type: :development
108
111
  prerelease: false
109
112
  version_requirements: !ruby/object:Gem::Requirement
@@ -111,6 +114,9 @@ dependencies:
111
114
  - - "~>"
112
115
  - !ruby/object:Gem::Version
113
116
  version: '2.0'
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: 2.0.8
114
120
  - !ruby/object:Gem::Dependency
115
121
  name: bundler-audit
116
122
  requirement: !ruby/object:Gem::Requirement
@@ -188,7 +194,7 @@ dependencies:
188
194
  version: '2.0'
189
195
  - - ">="
190
196
  - !ruby/object:Gem::Version
191
- version: 2.0.0
197
+ version: 2.0.3
192
198
  type: :development
193
199
  prerelease: false
194
200
  version_requirements: !ruby/object:Gem::Requirement
@@ -198,43 +204,43 @@ dependencies:
198
204
  version: '2.0'
199
205
  - - ">="
200
206
  - !ruby/object:Gem::Version
201
- version: 2.0.0
207
+ version: 2.0.3
202
208
  - !ruby/object:Gem::Dependency
203
- name: ruby-progressbar
209
+ name: turbo_tests2
204
210
  requirement: !ruby/object:Gem::Requirement
205
211
  requirements:
206
212
  - - "~>"
207
213
  - !ruby/object:Gem::Version
208
- version: '1.13'
214
+ version: '3.1'
215
+ - - ">="
216
+ - !ruby/object:Gem::Version
217
+ version: 3.1.1
209
218
  type: :development
210
219
  prerelease: false
211
220
  version_requirements: !ruby/object:Gem::Requirement
212
221
  requirements:
213
222
  - - "~>"
214
223
  - !ruby/object:Gem::Version
215
- version: '1.13'
224
+ version: '3.1'
225
+ - - ">="
226
+ - !ruby/object:Gem::Version
227
+ version: 3.1.1
216
228
  - !ruby/object:Gem::Dependency
217
- name: stone_checksums
229
+ name: ruby-progressbar
218
230
  requirement: !ruby/object:Gem::Requirement
219
231
  requirements:
220
232
  - - "~>"
221
233
  - !ruby/object:Gem::Version
222
- version: '1.0'
223
- - - ">="
224
- - !ruby/object:Gem::Version
225
- version: 1.0.3
234
+ version: '1.13'
226
235
  type: :development
227
236
  prerelease: false
228
237
  version_requirements: !ruby/object:Gem::Requirement
229
238
  requirements:
230
239
  - - "~>"
231
240
  - !ruby/object:Gem::Version
232
- version: '1.0'
233
- - - ">="
234
- - !ruby/object:Gem::Version
235
- version: 1.0.3
241
+ version: '1.13'
236
242
  - !ruby/object:Gem::Dependency
237
- name: gitmoji-regex
243
+ name: stone_checksums
238
244
  requirement: !ruby/object:Gem::Requirement
239
245
  requirements:
240
246
  - - "~>"
@@ -254,25 +260,25 @@ dependencies:
254
260
  - !ruby/object:Gem::Version
255
261
  version: 1.0.3
256
262
  - !ruby/object:Gem::Dependency
257
- name: kettle-soup-cover
263
+ name: gitmoji-regex
258
264
  requirement: !ruby/object:Gem::Requirement
259
265
  requirements:
260
266
  - - "~>"
261
267
  - !ruby/object:Gem::Version
262
- version: '1.1'
268
+ version: '2.0'
263
269
  - - ">="
264
270
  - !ruby/object:Gem::Version
265
- version: 1.1.1
271
+ version: 2.0.1
266
272
  type: :development
267
273
  prerelease: false
268
274
  version_requirements: !ruby/object:Gem::Requirement
269
275
  requirements:
270
276
  - - "~>"
271
277
  - !ruby/object:Gem::Version
272
- version: '1.1'
278
+ version: '2.0'
273
279
  - - ">="
274
280
  - !ruby/object:Gem::Version
275
- version: 1.1.1
281
+ version: 2.0.1
276
282
  - !ruby/object:Gem::Dependency
277
283
  name: kramdown
278
284
  requirement: !ruby/object:Gem::Requirement
@@ -349,10 +355,10 @@ licenses:
349
355
  - MIT
350
356
  metadata:
351
357
  homepage_uri: https://structuredmerge.org
352
- source_code_uri: https://github.com/galtzo-floss/yard-fence/tree/v0.9.1
353
- changelog_uri: https://github.com/galtzo-floss/yard-fence/blob/v0.9.1/CHANGELOG.md
358
+ source_code_uri: https://github.com/galtzo-floss/yard-fence/tree/v0.9.2
359
+ changelog_uri: https://github.com/galtzo-floss/yard-fence/blob/v0.9.2/CHANGELOG.md
354
360
  bug_tracker_uri: https://github.com/galtzo-floss/yard-fence/issues
355
- documentation_uri: https://www.rubydoc.info/gems/yard-fence/0.9.1
361
+ documentation_uri: https://www.rubydoc.info/gems/yard-fence/0.9.2
356
362
  funding_uri: https://github.com/sponsors/pboling
357
363
  wiki_uri: https://github.com/galtzo-floss/yard-fence/wiki
358
364
  news_uri: https://www.railsbling.com/tags/yard-fence
@@ -381,7 +387,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
381
387
  - !ruby/object:Gem::Version
382
388
  version: '0'
383
389
  requirements: []
384
- rubygems_version: 4.0.11
390
+ rubygems_version: 4.0.10
385
391
  specification_version: 4
386
392
  summary: "\U0001F372 A brace converter for the markdown fences in your YARD"
387
393
  test_files: []
metadata.gz.sig CHANGED
Binary file