hoe-markdown 1.5.1 → 1.7.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 +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/CHANGELOG.md +14 -0
- data/lib/hoe/markdown/util.rb +27 -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
@@ -1,5 +1,19 @@
|
|
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
|
+
|
10
|
+
## v1.6.0 / 2023-11-19
|
11
|
+
|
12
|
+
Fix:
|
13
|
+
|
14
|
+
- Do not linkify things like that look like issues when they are part of a word, like "LH#123".
|
15
|
+
|
16
|
+
|
3
17
|
## v1.5.1 / 2023-10-10
|
4
18
|
|
5
19
|
Remove experimental code that was accidentally included in v1.5.0.
|
data/lib/hoe/markdown/util.rb
CHANGED
@@ -2,6 +2,9 @@ class Hoe
|
|
2
2
|
module Markdown
|
3
3
|
module Util
|
4
4
|
GITHUB_ISSUE_MENTION_REGEX = %r{
|
5
|
+
# not immediately preceded by a word character
|
6
|
+
(?<!\w)
|
7
|
+
|
5
8
|
# issue number, like '#1234'
|
6
9
|
\#([[:digit:]]+)
|
7
10
|
|
@@ -54,13 +57,33 @@ class Hoe
|
|
54
57
|
}x
|
55
58
|
|
56
59
|
markdown
|
57
|
-
.gsub(GITHUB_ISSUE_MENTION_REGEX
|
58
|
-
|
59
|
-
|
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
|
+
}
|
60
69
|
end
|
61
70
|
|
62
71
|
def self.linkify_github_usernames(markdown)
|
63
|
-
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
|
64
87
|
end
|
65
88
|
end
|
66
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: []
|