gitlab_kramdown 0.27.0 → 0.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +1 -1
- data/lib/gitlab_kramdown/parser/autolink.rb +3 -3
- data/lib/gitlab_kramdown/parser/escape.rb +1 -1
- data/lib/gitlab_kramdown/parser/fenced_blockquote.rb +2 -2
- data/lib/gitlab_kramdown/parser/fenced_codeblock.rb +2 -2
- data/lib/gitlab_kramdown/parser/header.rb +6 -6
- data/lib/gitlab_kramdown/parser/label.rb +1 -1
- data/lib/gitlab_kramdown/parser/reference.rb +12 -12
- data/lib/gitlab_kramdown/parser/strikethrough.rb +2 -2
- data/lib/gitlab_kramdown/version.rb +1 -1
- metadata +20 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a3f55d728fb744dc0221ba1f43fe17616eac491afa3a996dffa4073a68dd79a
|
4
|
+
data.tar.gz: f8ae17fba95134a3d925b99fcde8bdefe9844402aae6ec86fe03e1b6cabacb31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a58281f1fecd322ceb7042f4aa7caeade6cc5131d3dc5966d30b21c6be8326636de4092a9ebfeb4b8ab3e6bcd5db477572f8e7bddf1974981d441c0132f87dde
|
7
|
+
data.tar.gz: 91a09638a0d145b7e7d2ac943ca1983a6461d4b24357050b082f63fd9061f5942208fdb9787ceb1c9a1e485fa6b63cb367cd14650a18ddd30f273af5b4064375
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.29.0] - 2024-02-12
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
|
14
|
+
- Bump project version dependencies.
|
15
|
+
- Make Ruby 3.1 the minimum supported version.
|
16
|
+
|
17
|
+
## [0.28.0] - 2024-02-09
|
18
|
+
|
19
|
+
### Changed
|
20
|
+
|
21
|
+
- Bump project version dependencies.
|
22
|
+
|
10
23
|
## [0.27.0] - 2023-06-04
|
11
24
|
|
12
25
|
### Changed
|
@@ -236,6 +249,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
236
249
|
- Special GitLab References
|
237
250
|
- Multiline Blockquote
|
238
251
|
|
252
|
+
[0.28.0]: https://gitlab.com/gitlab-org/ruby/gems/gitlab_kramdown/-/compare/v0.27.0...v0.28.0
|
239
253
|
[0.27.0]: https://gitlab.com/gitlab-org/ruby/gems/gitlab_kramdown/-/compare/v0.26.0...v0.27.0
|
240
254
|
[0.26.0]: https://gitlab.com/gitlab-org/ruby/gems/gitlab_kramdown/-/compare/v0.25.0...v0.26.0
|
241
255
|
[0.25.0]: https://gitlab.com/gitlab-org/ruby/gems/gitlab_kramdown/-/compare/v0.24.0...v0.25.0
|
data/README.md
CHANGED
@@ -8,8 +8,8 @@ module GitlabKramdown
|
|
8
8
|
#
|
9
9
|
# @see https://docs.gitlab.com/ee/user/markdown.html#url-auto-linking
|
10
10
|
module Autolink
|
11
|
-
PUNCTUATION_PAIRS = /['"][)\]}][(\[{]
|
12
|
-
ACHARS = /[[:alnum:]]_
|
11
|
+
PUNCTUATION_PAIRS = /['"][)\]}][(\[{]/
|
12
|
+
ACHARS = /[[:alnum:]]_/
|
13
13
|
|
14
14
|
AUTOLINK_START = %r{
|
15
15
|
(?<uri>
|
@@ -19,7 +19,7 @@ module GitlabKramdown
|
|
19
19
|
|
|
20
20
|
[-.#{ACHARS}]+@[-#{ACHARS}]+(?:\.[-#{ACHARS}]+)*\.[a-z]+
|
21
21
|
)
|
22
|
-
}x
|
22
|
+
}x
|
23
23
|
|
24
24
|
def self.included(klass)
|
25
25
|
return if klass.has_parser?(:gitlab_autolink)
|
@@ -8,7 +8,7 @@ module GitlabKramdown
|
|
8
8
|
#
|
9
9
|
# Based on Kramdown GFM implementation
|
10
10
|
module Escape
|
11
|
-
ESCAPED_CHARS_GFM = /\\([\\.*_+`<>()\[\]{}#!:|"'$=\-~])
|
11
|
+
ESCAPED_CHARS_GFM = /\\([\\.*_+`<>()\[\]{}#!:|"'$=\-~])/
|
12
12
|
|
13
13
|
def self.included(klass)
|
14
14
|
return if klass.has_parser?(:escape_chars_gitlab)
|
@@ -8,7 +8,7 @@ module GitlabKramdown
|
|
8
8
|
#
|
9
9
|
# @see https://docs.gitlab.com/ee/user/markdown.html#multiline-blockquote
|
10
10
|
module FencedBlockquote
|
11
|
-
FENCED_BLOCKQUOTE_START = />{3}/x
|
11
|
+
FENCED_BLOCKQUOTE_START = />{3}/x
|
12
12
|
|
13
13
|
FENCED_BLOCKQUOTE_MATCH = %r{
|
14
14
|
^(?<delimiter>>{3}) # line must start with >>>
|
@@ -19,7 +19,7 @@ module GitlabKramdown
|
|
19
19
|
\k<delimiter> # same delimiter used to open the block
|
20
20
|
[ \t]* # any amount of trailling whitespace
|
21
21
|
\s
|
22
|
-
}xm
|
22
|
+
}xm
|
23
23
|
|
24
24
|
def self.included(klass)
|
25
25
|
return if klass.has_parser?(:fenced_blockquote)
|
@@ -15,8 +15,8 @@ module GitlabKramdown
|
|
15
15
|
#
|
16
16
|
# @see https://docs.gitlab.com/ee/user/markdown.html#code-and-syntax-highlighting
|
17
17
|
module FencedCodeblock
|
18
|
-
FENCED_CODEBLOCK_START = /^ {0,3}[~`]{3,}
|
19
|
-
FENCED_CODEBLOCK_MATCH = /^ {0,3}(([~`]){3,})\s*?((\S+?)(?:\?\S*)?)?\s*?\n(.*?)^ {0,3}\1\2*\s*?\n/m
|
18
|
+
FENCED_CODEBLOCK_START = /^ {0,3}[~`]{3,}/
|
19
|
+
FENCED_CODEBLOCK_MATCH = /^ {0,3}(([~`]){3,})\s*?((\S+?)(?:\?\S*)?)?\s*?\n(.*?)^ {0,3}\1\2*\s*?\n/m
|
20
20
|
|
21
21
|
def self.included(klass)
|
22
22
|
return if klass.has_parser?(:codeblock_fenced_gitlab)
|
@@ -9,12 +9,12 @@ module GitlabKramdown
|
|
9
9
|
#
|
10
10
|
# @see https://docs.gitlab.com/ee/user/markdown.html#headers
|
11
11
|
module Header
|
12
|
-
HEADER_ID = /(?:[ \t]+\{\#([A-Za-z][\w:-]*)\})
|
12
|
+
HEADER_ID = /(?:[ \t]+\{\#([A-Za-z][\w:-]*)\})?/
|
13
13
|
SETEXT_HEADER_START = %r{
|
14
14
|
^(#{Kramdown::Parser::Kramdown::OPT_SPACE}[^ \t].*?)
|
15
15
|
#{HEADER_ID}[ \t]*?\n
|
16
16
|
(-|=)+\s*?\n
|
17
|
-
}x
|
17
|
+
}x
|
18
18
|
|
19
19
|
def self.included(klass)
|
20
20
|
klass.define_parser(:setext_gitlab_header, SETEXT_HEADER_START)
|
@@ -44,8 +44,8 @@ module GitlabKramdown
|
|
44
44
|
true
|
45
45
|
end
|
46
46
|
|
47
|
-
ATX_HEADER_START = /^\#{1,6}
|
48
|
-
ATX_HEADER_MATCH = /^(\#{1,6})(.+?(?:\\#)?)\s*?#*#{HEADER_ID}\s*?\n
|
47
|
+
ATX_HEADER_START = /^\#{1,6}/
|
48
|
+
ATX_HEADER_MATCH = /^(\#{1,6})(.+?(?:\\#)?)\s*?#*#{HEADER_ID}\s*?\n/
|
49
49
|
|
50
50
|
# Parse the Atx header at the current location.
|
51
51
|
def parse_atx_gitlab_header
|
@@ -72,8 +72,8 @@ module GitlabKramdown
|
|
72
72
|
true
|
73
73
|
end
|
74
74
|
|
75
|
-
NON_WORD_RE = /[^\p{Word}\- \t]
|
76
|
-
MARKDOWN_LINK_TEXT = /\[(?<link_text>[^\]]+)\]\((?<link_url>[^)]+)\)
|
75
|
+
NON_WORD_RE = /[^\p{Word}\- \t]/
|
76
|
+
MARKDOWN_LINK_TEXT = /\[(?<link_text>[^\]]+)\]\((?<link_url>[^)]+)\)/
|
77
77
|
|
78
78
|
def generate_header_id(text)
|
79
79
|
result = text.downcase
|
@@ -15,7 +15,7 @@ module GitlabKramdown
|
|
15
15
|
[A-Za-z0-9_\-?.&]+ | # String-based single-word label title, or
|
16
16
|
".+?" # String-based multi-word label surrounded in quotes
|
17
17
|
)
|
18
|
-
}x
|
18
|
+
}x
|
19
19
|
|
20
20
|
def self.included(klass)
|
21
21
|
klass.define_parser(:label, PROJECT_LABEL_PATTERN, '\~')
|
@@ -11,51 +11,51 @@ module GitlabKramdown
|
|
11
11
|
# @see GitlabKramdown::Parser::Label
|
12
12
|
# @see https://docs.gitlab.com/ee/user/markdown.html#special-gitlab-references
|
13
13
|
module Reference
|
14
|
-
PATH_REGEX = /[a-zA-Z0-9_.][a-zA-Z0-9_\-.]
|
14
|
+
PATH_REGEX = /[a-zA-Z0-9_.][a-zA-Z0-9_\-.]+/
|
15
15
|
|
16
16
|
NAMESPACE_FORMAT_REGEX = %r{
|
17
17
|
(?:#{PATH_REGEX}[a-zA-Z0-9_-])
|
18
18
|
(?<!\.git|\.atom)
|
19
19
|
|[a-zA-Z0-9_]
|
20
|
-
}x
|
20
|
+
}x
|
21
21
|
|
22
|
-
FULL_NAMESPACE_FORMAT_REGEX = %r{(#{NAMESPACE_FORMAT_REGEX}/)*#{NAMESPACE_FORMAT_REGEX}}
|
23
|
-
ALWAYS_FULL_NAMESPACE_FORMAT_REGEX = %r{(#{NAMESPACE_FORMAT_REGEX}/)+#{NAMESPACE_FORMAT_REGEX}}
|
22
|
+
FULL_NAMESPACE_FORMAT_REGEX = %r{(#{NAMESPACE_FORMAT_REGEX}/)*#{NAMESPACE_FORMAT_REGEX}}
|
23
|
+
ALWAYS_FULL_NAMESPACE_FORMAT_REGEX = %r{(#{NAMESPACE_FORMAT_REGEX}/)+#{NAMESPACE_FORMAT_REGEX}}
|
24
24
|
|
25
|
-
NAMESPACE_EXTRACTION_PATTERN = /(?<namespace>#{ALWAYS_FULL_NAMESPACE_FORMAT_REGEX})\z
|
25
|
+
NAMESPACE_EXTRACTION_PATTERN = /(?<namespace>#{ALWAYS_FULL_NAMESPACE_FORMAT_REGEX})\z/
|
26
26
|
|
27
27
|
USER_GROUP_PATTERN = %r{
|
28
28
|
#{Regexp.escape('@')}
|
29
29
|
(?<user>#{FULL_NAMESPACE_FORMAT_REGEX})
|
30
|
-
}x
|
30
|
+
}x
|
31
31
|
|
32
32
|
PROJECT_COMMIT_PATTERN = %r{
|
33
33
|
#{Regexp.escape('@')}
|
34
34
|
(?<commit>[a-f0-9]{7,40})
|
35
35
|
(?!\.{3})
|
36
|
-
}x
|
36
|
+
}x
|
37
37
|
|
38
38
|
PROJECT_COMMIT_DIFF_PATTERN = %r{
|
39
39
|
#{Regexp.escape('@')}
|
40
40
|
(?<commit_source>[a-f0-9]{7,40})
|
41
41
|
\.{3}
|
42
42
|
(?<commit_target>[a-f0-9]{7,40})
|
43
|
-
}x
|
43
|
+
}x
|
44
44
|
|
45
45
|
PROJECT_ISSUE_PATTERN = %r{
|
46
46
|
#{Regexp.escape('#')}
|
47
47
|
(?<issue>[1-9][0-9]*)
|
48
|
-
}x
|
48
|
+
}x
|
49
49
|
|
50
50
|
PROJECT_MERGE_REQUEST_PATTERN = %r{
|
51
51
|
#{Regexp.escape('!')}
|
52
52
|
(?<merge_request>[1-9][0-9]*)
|
53
|
-
}x
|
53
|
+
}x
|
54
54
|
|
55
55
|
PROJECT_SNIPPET_PATTERN = %r{
|
56
56
|
#{Regexp.escape('$')}
|
57
57
|
(?<snippet>[1-9][0-9]*)
|
58
|
-
}x
|
58
|
+
}x
|
59
59
|
|
60
60
|
def self.included(klass)
|
61
61
|
klass.define_parser(:user_group_mention, USER_GROUP_PATTERN, '@')
|
@@ -146,7 +146,7 @@ module GitlabKramdown
|
|
146
146
|
end
|
147
147
|
|
148
148
|
href = "#{@options[:gitlab_url]}/#{namespace}/compare/" \
|
149
|
-
|
149
|
+
"#{@src[:commit_source]}...#{@src[:commit_target]}"
|
150
150
|
|
151
151
|
el = Kramdown::Element.new(:a, nil, { 'href' => href }, location: start_line_number)
|
152
152
|
add_text(reference_text, el)
|
@@ -11,7 +11,7 @@ module GitlabKramdown
|
|
11
11
|
#
|
12
12
|
# @see https://docs.gitlab.com/ee/user/markdown.html#emphasis
|
13
13
|
module Strikethrough
|
14
|
-
STRIKETHROUGH_DELIM =
|
14
|
+
STRIKETHROUGH_DELIM = /~~/
|
15
15
|
STRIKETHROUGH_MATCH = %r{
|
16
16
|
(?<re>
|
17
17
|
#{STRIKETHROUGH_DELIM} # start with ~~
|
@@ -20,7 +20,7 @@ module GitlabKramdown
|
|
20
20
|
(?<!\s|~) # something different than space and ~ (negative lookbehind)
|
21
21
|
#{STRIKETHROUGH_DELIM} # end with ~~
|
22
22
|
)
|
23
|
-
}x
|
23
|
+
}x
|
24
24
|
|
25
25
|
def self.included(klass)
|
26
26
|
klass.define_parser(:strikethrough_gitlab, STRIKETHROUGH_MATCH, '~~')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab_kramdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.29.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Mazetto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.
|
33
|
+
version: 4.3.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.
|
40
|
+
version: 4.3.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: nokogiri
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.16.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.16.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: asciidoctor-plantuml
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,42 +72,42 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 13.
|
75
|
+
version: 13.2.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 13.
|
82
|
+
version: 13.2.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rdoc
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 6.
|
89
|
+
version: 6.7.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 6.
|
96
|
+
version: 6.7.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: bundler
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 2.
|
103
|
+
version: 2.5.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 2.
|
110
|
+
version: 2.5.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: simplecov
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,28 +128,28 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: 12.0.0
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: 12.0.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: rspec
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 3.
|
145
|
+
version: 3.13.0
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 3.
|
152
|
+
version: 3.13.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: rspec_junit_formatter
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 2.
|
173
|
+
version: 2.13.0
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 2.
|
180
|
+
version: 2.13.0
|
181
181
|
description: GitLab Flavored Markdown extensions on top of Kramdown markup. Tries
|
182
182
|
to be as close as possible to existing extensions.
|
183
183
|
email:
|
@@ -218,14 +218,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
218
218
|
requirements:
|
219
219
|
- - ">="
|
220
220
|
- !ruby/object:Gem::Version
|
221
|
-
version: '3.
|
221
|
+
version: '3.1'
|
222
222
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
223
223
|
requirements:
|
224
224
|
- - ">="
|
225
225
|
- !ruby/object:Gem::Version
|
226
226
|
version: '0'
|
227
227
|
requirements: []
|
228
|
-
rubygems_version: 3.
|
228
|
+
rubygems_version: 3.5.17
|
229
229
|
signing_key:
|
230
230
|
specification_version: 4
|
231
231
|
summary: GitLab Flavored Kramdown
|