gitlab_kramdown 0.28.0 → 0.29.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: 996c44df9a190a5a789a5d3b9fd38a22c6e21b84b7091b9b2fbce3e7c406ffe5
4
- data.tar.gz: 43896bc674ecbae66af3b5f0ec1c84be09506d3524bd20db14cf938fae1056ad
3
+ metadata.gz: 9a3f55d728fb744dc0221ba1f43fe17616eac491afa3a996dffa4073a68dd79a
4
+ data.tar.gz: f8ae17fba95134a3d925b99fcde8bdefe9844402aae6ec86fe03e1b6cabacb31
5
5
  SHA512:
6
- metadata.gz: 95bd5ab7e57e648217bf5a72855726a4e3b7c67d8458cbd2f8f54404b82fc5ffc434fb8ce4d3af203dc17905015be030768d42d29ce4091004f0087601e114bb
7
- data.tar.gz: 8bb11468e3da5dcbbc2756b9df8a6d2a7a7f4f0c3a498d43985710ee5ab02898400f9a3b2439a65b671b4666be7c8a1839000ca2d83c2c52dd79b6a00047fa5d
6
+ metadata.gz: a58281f1fecd322ceb7042f4aa7caeade6cc5131d3dc5966d30b21c6be8326636de4092a9ebfeb4b8ab3e6bcd5db477572f8e7bddf1974981d441c0132f87dde
7
+ data.tar.gz: 91a09638a0d145b7e7d2ac943ca1983a6461d4b24357050b082f63fd9061f5942208fdb9787ceb1c9a1e485fa6b63cb367cd14650a18ddd30f273af5b4064375
data/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ 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
+
10
17
  ## [0.28.0] - 2024-02-09
11
18
 
12
19
  ### Changed
data/README.md CHANGED
@@ -74,7 +74,7 @@ Kramdown::Document.new(source, input: 'GitlabKramdown', syntax_highlighter: :rou
74
74
 
75
75
  ## Supported and tested Ruby versions
76
76
 
77
- - Ruby 3.0
77
+ - Ruby 3.1
78
78
  - Ruby 3.2
79
79
 
80
80
  ## Release a new version
@@ -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 = /['"][)\]}][(\[{]/.freeze
12
- ACHARS = /[[:alnum:]]_/.freeze
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.freeze
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 = /\\([\\.*_+`<>()\[\]{}#!:|"'$=\-~])/.freeze
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.freeze
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.freeze
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,}/.freeze
19
- FENCED_CODEBLOCK_MATCH = /^ {0,3}(([~`]){3,})\s*?((\S+?)(?:\?\S*)?)?\s*?\n(.*?)^ {0,3}\1\2*\s*?\n/m.freeze
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:-]*)\})?/.freeze
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.freeze
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}/.freeze
48
- ATX_HEADER_MATCH = /^(\#{1,6})(.+?(?:\\#)?)\s*?#*#{HEADER_ID}\s*?\n/.freeze
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]/.freeze
76
- MARKDOWN_LINK_TEXT = /\[(?<link_text>[^\]]+)\]\((?<link_url>[^)]+)\)/.freeze
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.freeze
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_\-.]+/.freeze
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.freeze
20
+ }x
21
21
 
22
- FULL_NAMESPACE_FORMAT_REGEX = %r{(#{NAMESPACE_FORMAT_REGEX}/)*#{NAMESPACE_FORMAT_REGEX}}.freeze
23
- ALWAYS_FULL_NAMESPACE_FORMAT_REGEX = %r{(#{NAMESPACE_FORMAT_REGEX}/)+#{NAMESPACE_FORMAT_REGEX}}.freeze
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/.freeze
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.freeze
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.freeze
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.freeze
43
+ }x
44
44
 
45
45
  PROJECT_ISSUE_PATTERN = %r{
46
46
  #{Regexp.escape('#')}
47
47
  (?<issue>[1-9][0-9]*)
48
- }x.freeze
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.freeze
53
+ }x
54
54
 
55
55
  PROJECT_SNIPPET_PATTERN = %r{
56
56
  #{Regexp.escape('$')}
57
57
  (?<snippet>[1-9][0-9]*)
58
- }x.freeze
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
- "#{@src[:commit_source]}...#{@src[:commit_target]}"
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 = /~~/.freeze
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.freeze
23
+ }x
24
24
 
25
25
  def self.included(klass)
26
26
  klass.define_parser(:strikethrough_gitlab, STRIKETHROUGH_MATCH, '~~')
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitlabKramdown
4
- VERSION = '0.28.0'
4
+ VERSION = '0.29.0'
5
5
  end
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.28.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: 2024-02-09 00:00:00.000000000 Z
11
+ date: 2024-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 4.2.0
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.2.0
40
+ version: 4.3.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nokogiri
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -72,28 +72,28 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 13.1.0
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.1.0
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.6.0
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.6.0
96
+ version: 6.7.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: bundler
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 11.0.0
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: 11.0.0
138
+ version: 12.0.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rspec
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -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.0'
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.5.6
228
+ rubygems_version: 3.5.17
229
229
  signing_key:
230
230
  specification_version: 4
231
231
  summary: GitLab Flavored Kramdown