yard-fence 0.9.0 → 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: 9d5f096b0f24b04537ca7eedf32025ac2ff3f4fbcd2ffd3f8a61858cb22dd987
4
- data.tar.gz: d69fd384aee0052908e6a182d46f148f924d4427c983a4aef53b612b6230edb6
3
+ metadata.gz: 592d30a22117c36ce4540f48dda1c6c712db78503fab52030ee0e5c628858397
4
+ data.tar.gz: fa9a285483a488d420916ec7032e9a0b6687ca881eec942a44c150746c99997e
5
5
  SHA512:
6
- metadata.gz: ff41883cf435550001b5a76279770622613fac37492e87649c6cc740e21e7e43d7f9d99a80e844fd0d117e07f6ba4b8fd40d8603aa21bdbf381f6966236202c0
7
- data.tar.gz: '0960b5f3d1cd6373cd71f86c681e577406a0ffe6c2cdc36d3251e137c009795ea4ffc448e11545740bdc56e75d9c731e33e068c691812c4b8c7e06ce5f50f734'
6
+ metadata.gz: c139823c9d34f991b55595749f8de0208580040b3b8607dfc5c0405dc65f0fab4822c4cca602dc53bf1e637480594c783a4b891757b7994bb6892a08042d7f4f
7
+ data.tar.gz: c948d805490ecebb7b98e8d7225931aba11092d5b80e3b7d95e9bc0da0ae8d8a89c144175ca5f5d6c7f84505201996706823c8d104e63cdc31beedd38ba8762d
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -28,10 +28,35 @@ Please file a bug if you notice a violation of semantic versioning.
28
28
 
29
29
  ### Fixed
30
30
 
31
- - Fixed CI workflow setup for appraisal-based style and coverage jobs, locked-deps, and TruffleRuby 23.1.
32
-
33
31
  ### Security
34
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
+
44
+ ## [0.9.1] - 2026-05-24
45
+
46
+ - TAG: [v0.9.1][0.9.1t]
47
+ - COVERAGE: 97.71% -- 171/175 lines in 5 files
48
+ - BRANCH COVERAGE: 90.74% -- 49/54 branches in 5 files
49
+ - 47.37% documented
50
+
51
+ ### Changed
52
+
53
+ - Expanded the `rdoc` runtime dependency to allow `rdoc` 7.x while retaining
54
+ support for `rdoc` 6.11.x.
55
+
56
+ ### Fixed
57
+
58
+ - Fixed CI workflow setup for appraisal-based style and coverage jobs, locked-deps, and TruffleRuby 23.1.
59
+
35
60
  ## [0.9.0] - 2026-05-23
36
61
 
37
62
  - TAG: [v0.9.0][0.9.0t]
@@ -209,7 +234,11 @@ Please file a bug if you notice a violation of semantic versioning.
209
234
 
210
235
  - Initial release
211
236
 
212
- [Unreleased]: https://github.com/galtzo-floss/yard-fence/compare/v0.9.0...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
240
+ [0.9.1]: https://github.com/galtzo-floss/yard-fence/compare/v0.9.0...v0.9.1
241
+ [0.9.1t]: https://github.com/galtzo-floss/yard-fence/releases/tag/v0.9.1
213
242
  [0.9.0]: https://github.com/galtzo-floss/yard-fence/compare/v0.8.2...v0.9.0
214
243
  [0.9.0t]: https://github.com/galtzo-floss/yard-fence/releases/tag/v0.9.0
215
244
  [0.8.2]: https://github.com/galtzo-floss/yard-fence/compare/v0.8.1...v0.8.2
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.0"
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.0
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -41,16 +41,22 @@ dependencies:
41
41
  name: rdoc
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - "~>"
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '6.11'
47
+ - - "<"
48
+ - !ruby/object:Gem::Version
49
+ version: '8'
47
50
  type: :runtime
48
51
  prerelease: false
49
52
  version_requirements: !ruby/object:Gem::Requirement
50
53
  requirements:
51
- - - "~>"
54
+ - - ">="
52
55
  - !ruby/object:Gem::Version
53
56
  version: '6.11'
57
+ - - "<"
58
+ - !ruby/object:Gem::Version
59
+ version: '8'
54
60
  - !ruby/object:Gem::Dependency
55
61
  name: version_gem
56
62
  requirement: !ruby/object:Gem::Requirement
@@ -98,6 +104,9 @@ dependencies:
98
104
  - - "~>"
99
105
  - !ruby/object:Gem::Version
100
106
  version: '2.0'
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: 2.0.8
101
110
  type: :development
102
111
  prerelease: false
103
112
  version_requirements: !ruby/object:Gem::Requirement
@@ -105,6 +114,9 @@ dependencies:
105
114
  - - "~>"
106
115
  - !ruby/object:Gem::Version
107
116
  version: '2.0'
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: 2.0.8
108
120
  - !ruby/object:Gem::Dependency
109
121
  name: bundler-audit
110
122
  requirement: !ruby/object:Gem::Requirement
@@ -182,7 +194,7 @@ dependencies:
182
194
  version: '2.0'
183
195
  - - ">="
184
196
  - !ruby/object:Gem::Version
185
- version: 2.0.0
197
+ version: 2.0.3
186
198
  type: :development
187
199
  prerelease: false
188
200
  version_requirements: !ruby/object:Gem::Requirement
@@ -192,43 +204,43 @@ dependencies:
192
204
  version: '2.0'
193
205
  - - ">="
194
206
  - !ruby/object:Gem::Version
195
- version: 2.0.0
207
+ version: 2.0.3
196
208
  - !ruby/object:Gem::Dependency
197
- name: ruby-progressbar
209
+ name: turbo_tests2
198
210
  requirement: !ruby/object:Gem::Requirement
199
211
  requirements:
200
212
  - - "~>"
201
213
  - !ruby/object:Gem::Version
202
- version: '1.13'
214
+ version: '3.1'
215
+ - - ">="
216
+ - !ruby/object:Gem::Version
217
+ version: 3.1.1
203
218
  type: :development
204
219
  prerelease: false
205
220
  version_requirements: !ruby/object:Gem::Requirement
206
221
  requirements:
207
222
  - - "~>"
208
223
  - !ruby/object:Gem::Version
209
- version: '1.13'
224
+ version: '3.1'
225
+ - - ">="
226
+ - !ruby/object:Gem::Version
227
+ version: 3.1.1
210
228
  - !ruby/object:Gem::Dependency
211
- name: stone_checksums
229
+ name: ruby-progressbar
212
230
  requirement: !ruby/object:Gem::Requirement
213
231
  requirements:
214
232
  - - "~>"
215
233
  - !ruby/object:Gem::Version
216
- version: '1.0'
217
- - - ">="
218
- - !ruby/object:Gem::Version
219
- version: 1.0.3
234
+ version: '1.13'
220
235
  type: :development
221
236
  prerelease: false
222
237
  version_requirements: !ruby/object:Gem::Requirement
223
238
  requirements:
224
239
  - - "~>"
225
240
  - !ruby/object:Gem::Version
226
- version: '1.0'
227
- - - ">="
228
- - !ruby/object:Gem::Version
229
- version: 1.0.3
241
+ version: '1.13'
230
242
  - !ruby/object:Gem::Dependency
231
- name: gitmoji-regex
243
+ name: stone_checksums
232
244
  requirement: !ruby/object:Gem::Requirement
233
245
  requirements:
234
246
  - - "~>"
@@ -248,25 +260,25 @@ dependencies:
248
260
  - !ruby/object:Gem::Version
249
261
  version: 1.0.3
250
262
  - !ruby/object:Gem::Dependency
251
- name: kettle-soup-cover
263
+ name: gitmoji-regex
252
264
  requirement: !ruby/object:Gem::Requirement
253
265
  requirements:
254
266
  - - "~>"
255
267
  - !ruby/object:Gem::Version
256
- version: '1.1'
268
+ version: '2.0'
257
269
  - - ">="
258
270
  - !ruby/object:Gem::Version
259
- version: 1.1.1
271
+ version: 2.0.1
260
272
  type: :development
261
273
  prerelease: false
262
274
  version_requirements: !ruby/object:Gem::Requirement
263
275
  requirements:
264
276
  - - "~>"
265
277
  - !ruby/object:Gem::Version
266
- version: '1.1'
278
+ version: '2.0'
267
279
  - - ">="
268
280
  - !ruby/object:Gem::Version
269
- version: 1.1.1
281
+ version: 2.0.1
270
282
  - !ruby/object:Gem::Dependency
271
283
  name: kramdown
272
284
  requirement: !ruby/object:Gem::Requirement
@@ -343,10 +355,10 @@ licenses:
343
355
  - MIT
344
356
  metadata:
345
357
  homepage_uri: https://structuredmerge.org
346
- source_code_uri: https://github.com/galtzo-floss/yard-fence/tree/v0.9.0
347
- changelog_uri: https://github.com/galtzo-floss/yard-fence/blob/v0.9.0/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
348
360
  bug_tracker_uri: https://github.com/galtzo-floss/yard-fence/issues
349
- documentation_uri: https://www.rubydoc.info/gems/yard-fence/0.9.0
361
+ documentation_uri: https://www.rubydoc.info/gems/yard-fence/0.9.2
350
362
  funding_uri: https://github.com/sponsors/pboling
351
363
  wiki_uri: https://github.com/galtzo-floss/yard-fence/wiki
352
364
  news_uri: https://www.railsbling.com/tags/yard-fence
@@ -375,7 +387,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
375
387
  - !ruby/object:Gem::Version
376
388
  version: '0'
377
389
  requirements: []
378
- rubygems_version: 4.0.11
390
+ rubygems_version: 4.0.10
379
391
  specification_version: 4
380
392
  summary: "\U0001F372 A brace converter for the markdown fences in your YARD"
381
393
  test_files: []
metadata.gz.sig CHANGED
Binary file