hoe-markdown 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 691ec01696519d0617fa4458ae3564e57d39db8a9da5894781e39e79492808b3
4
- data.tar.gz: 245e4c2732dff69cc11afd044849be558ad9cf4b8568eb44321ba86945a7fbbd
3
+ metadata.gz: ec4f0613c872babc3ad05a0fc751e8fccd3cbe86903ad2b184e0d1c801f8dad1
4
+ data.tar.gz: bc67121c659c02f5bde9fcc351ba90f9c019b25ba916c7b53da1b598798c0a43
5
5
  SHA512:
6
- metadata.gz: f9e5a52dd375e951d91f99e8beeb04c326a8ce06060a4478a96d94ea47be0c6cb577f859fea3054c1a8be4c21d6f446f991c589345f4655b45e7d3ef2cbea035
7
- data.tar.gz: b6d2102391c2549903041d395a10570d5c593cf3f3c9f5bbec31957b8e55a0a84549a18ea8e36008eb089106db5850782b3c1061fe10819c8040b759fc6a5bc3
6
+ metadata.gz: 12c36a92d335f28bf4aef752e07a5998c950ee2ef99f9392a00a83612fc09aad1abe4856f11912fce633f6850194e8209df1d7268ea4d75fe3404ff57502e4cc
7
+ data.tar.gz: 85534f4dce74c768a512402418ae32ed2249ecfc1e4e73ddd497c3172ba486ec33633a2b23533fdf26bc85e863b9a633df05df2992212681492ef2c9ebd5c1c4
@@ -17,7 +17,7 @@ jobs:
17
17
  strategy:
18
18
  fail-fast: false
19
19
  matrix:
20
- ruby: ["2.7", "3.0", "3.1", "3.2", "head"]
20
+ ruby: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4", "head"]
21
21
  runs-on: ubuntu-latest
22
22
  steps:
23
23
  - uses: actions/checkout@v4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Hoe::Markdown CHANGELOG
2
2
 
3
+ ## v1.7.0 / 2025-01-02
4
+
5
+ Fix:
6
+
7
+ - Do not linkify link refs and link ref definitions. #5 @halostatue
8
+
9
+
3
10
  ## v1.6.0 / 2023-11-19
4
11
 
5
12
  Fix:
@@ -57,13 +57,33 @@ class Hoe
57
57
  }x
58
58
 
59
59
  markdown
60
- .gsub(GITHUB_ISSUE_MENTION_REGEX, "[#\\1](#{issues_uri}/\\1)")
61
- .gsub(issue_uri_regex, "[#\\1](#{issues_uri}/\\1)")
62
- .gsub(pull_uri_regex, "[#\\1](#{pull_uri}/\\1)")
60
+ .gsub(GITHUB_ISSUE_MENTION_REGEX) {
61
+ __replace_with_link(Regexp.last_match, "[#%<id>s](#{issues_uri}/%<id>s)")
62
+ }
63
+ .gsub(issue_uri_regex) {
64
+ __replace_with_link(Regexp.last_match, "[#%<id>s](#{issues_uri}/%<id>s)")
65
+ }
66
+ .gsub(pull_uri_regex) {
67
+ __replace_with_link(Regexp.last_match, "[#%<id>s](#{pull_uri}/%<id>s)")
68
+ }
63
69
  end
64
70
 
65
71
  def self.linkify_github_usernames(markdown)
66
- markdown.gsub(GITHUB_USER_REGEX, "[@\\1](https://github.com/\\1)")
72
+ markdown.gsub(GITHUB_USER_REGEX) {
73
+ __replace_with_link(Regexp.last_match, "[@%<id>s](https://github.com/%<id>s)")
74
+ }
75
+ end
76
+
77
+ def self.__replace_with_link(match, link)
78
+ skip =
79
+ (match.pre_match.end_with?("\n[") && match.post_match =~ /\A\]:\s+.+\n/) ||
80
+ (match.pre_match =~ /\]\[[^\]]*\z/ && match.post_match =~ /\A[^\]]*\]/)
81
+
82
+ if skip
83
+ match[0]
84
+ else
85
+ link % {id: match[1]}
86
+ end
67
87
  end
68
88
  end
69
89
  end
@@ -1,5 +1,5 @@
1
1
  class Hoe
2
2
  module Markdown
3
- VERSION = "1.6.0"
3
+ VERSION = "1.7.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoe-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-11-19 00:00:00.000000000 Z
10
+ date: 2025-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rake
@@ -54,7 +53,6 @@ metadata:
54
53
  homepage_uri: https://github.com/flavorjones/hoe-markdown
55
54
  source_code_uri: https://github.com/flavorjones/hoe-markdown
56
55
  changelog_uri: https://github.com/flavorjones/hoe-markdown/blob/master/CHANGELOG.md
57
- post_install_message:
58
56
  rdoc_options: []
59
57
  require_paths:
60
58
  - lib
@@ -69,8 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
67
  - !ruby/object:Gem::Version
70
68
  version: '0'
71
69
  requirements: []
72
- rubygems_version: 3.4.19
73
- signing_key:
70
+ rubygems_version: 3.6.2
74
71
  specification_version: 4
75
72
  summary: Hoe plugin with helpers for markdown documentation files.
76
73
  test_files: []