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 +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/CHANGELOG.md +7 -0
- data/lib/hoe/markdown/util.rb +24 -4
- data/lib/hoe/markdown/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec4f0613c872babc3ad05a0fc751e8fccd3cbe86903ad2b184e0d1c801f8dad1
|
4
|
+
data.tar.gz: bc67121c659c02f5bde9fcc351ba90f9c019b25ba916c7b53da1b598798c0a43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12c36a92d335f28bf4aef752e07a5998c950ee2ef99f9392a00a83612fc09aad1abe4856f11912fce633f6850194e8209df1d7268ea4d75fe3404ff57502e4cc
|
7
|
+
data.tar.gz: 85534f4dce74c768a512402418ae32ed2249ecfc1e4e73ddd497c3172ba486ec33633a2b23533fdf26bc85e863b9a633df05df2992212681492ef2c9ebd5c1c4
|
data/.github/workflows/ci.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/lib/hoe/markdown/util.rb
CHANGED
@@ -57,13 +57,33 @@ class Hoe
|
|
57
57
|
}x
|
58
58
|
|
59
59
|
markdown
|
60
|
-
.gsub(GITHUB_ISSUE_MENTION_REGEX
|
61
|
-
|
62
|
-
|
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
|
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
|
data/lib/hoe/markdown/version.rb
CHANGED
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.
|
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:
|
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.
|
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: []
|