gitlab_kramdown 0.10.0 → 0.14.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: 46edf71a2cbaa91e378788b9ff7b369c2fe864211cf1d6b8ba673b77a9a13bca
4
- data.tar.gz: 9d9411975cb4f61ece5f8033db432a4f1cd6236c99c606aa4fc953654c941572
3
+ metadata.gz: 930bb134f7712a73d1605ed65ea9229b5840a2f8fcb5d3f6231558d069604029
4
+ data.tar.gz: ba62a524b5e9e1db173513a32f185f2f9dd70a59aeb6fe8baf25083458f00425
5
5
  SHA512:
6
- metadata.gz: ee0f367f0d723917d0c5a96650c5a2a9e7e78cbf4c7da762e4f42a3ba563b77562e4cb020f3e67ff67671d345de8b93e046b338d9eb857e955ae230184c685d1
7
- data.tar.gz: a302ab1dbc1cb14c1ca4e08087268ca144af2e1c00282ff13bd8ec80f83c96c25e1a3c4e829027fdc97758d67d5ace9c38b38043c80f54e0115d735cda5a6e73
6
+ metadata.gz: f92d388c0c2a9e75f806faaff12f472be14293c634ad653598a1f5c780d9f6ab1b39316fe17fc4e9511fd8031c8576b0def97df0d64747adffd937a76ca06681
7
+ data.tar.gz: 18b4fb946df2cfa4911b9706daf01232482d0ac11b7ea3678a10878eca3e5152cc8164ce6a45aa5740d95e55db63786abc6c0771b17b8dbc49dc124e97b42054
data/CHANGELOG.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Changelog
2
+
2
3
  All notable changes to this project will be documented in this file.
3
4
 
4
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
@@ -6,6 +7,31 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
7
 
7
8
  ## [Unreleased]
8
9
 
10
+ ## [0.14.0] - 2021-08-10
11
+
12
+ ### Changes
13
+
14
+ - Update Gem dependencies. In particular, update Nokogiri to version 1.12.x.
15
+
16
+ ## [0.13.0] - 2021-07-02
17
+
18
+ ### Changes
19
+
20
+ - Update Gem dependencies
21
+
22
+ ## [0.12.0] - 2021-03-22
23
+
24
+ ### Changed
25
+
26
+ - Update Gem dependencies. In particular, Kramdown to version 2.3.1.
27
+
28
+ ## [0.11.0] - 2021-01-25
29
+
30
+ ### Changed
31
+
32
+ - Update Gem dependencies.
33
+ - Update minimum required Ruby to 2.7.x.
34
+
9
35
  ## [0.10.0] - 2020-08-27
10
36
 
11
37
  - Update Gem dependencies
@@ -13,79 +39,109 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
13
39
  ## [0.9.0] - 2019-10-17
14
40
 
15
41
  ### Fixed
42
+
16
43
  - Fix very long IDs for headers that include links.
17
44
 
18
45
  ### Added
46
+
19
47
  - Images should be clickable and linked to itself
20
48
  - Clickable images behavior is configurable
21
49
 
22
- ### [0.8.0] - 2019-10-14
50
+ ## [0.8.0] - 2019-10-14
23
51
 
24
52
  ### Changed
53
+
25
54
  - Revert "Fix very long IDs for headers that include links"
26
55
 
27
- ### [0.7.0] - 2019-10-11
56
+ ## [0.7.0] - 2019-10-11
28
57
 
29
58
  ### Added
59
+
30
60
  - Add support for PlantUML
31
61
 
32
62
  ### Changed
63
+
33
64
  - Ruby 2.4 support is dropped.
34
65
  - Fix very long IDs for headers that include links.
35
66
 
36
67
  ## [0.6.0] - 2019-05-07
68
+
37
69
  ### Changed
70
+
38
71
  - URL Autolinks are now disabled by default (you can re-enable with `autolink: true` configuration param)
39
72
 
40
73
  ### Added
74
+
41
75
  - Added support for rendering Mermaid when their JS is available
42
76
 
43
77
  ## [0.5.0] - 2019-04-09
78
+
44
79
  ### Added
80
+
45
81
  - Strikethrough support
46
82
 
47
83
  ## [0.4.2] - 2018-11-21
84
+
48
85
  ### Changed
86
+
49
87
  - URL autolinks will not execute inside `[]()` or `[]` blocks
50
88
  - Freezing `kramdown` version to allow only patchlevel changes
51
89
 
52
90
  ## [0.4.1] - 2018-11-02
91
+
53
92
  ### Added
93
+
54
94
  - Codebase now have a benchmark utility to compare with plain Kramdown
55
95
 
56
96
  ### Changed
97
+
57
98
  - Many performance improvements on existing RegExp rules
58
99
  - Improve gemspec metadata and include only needed files on gem
59
100
 
60
101
  ## [0.4.0] - 2018-04-12
102
+
61
103
  ### Added
104
+
62
105
  - URL auto-linking support
63
106
 
64
107
  ### Changed
108
+
65
109
  - Fixed many inconsistencies in references autolink
66
110
 
67
111
  ## [0.3.0] - 2018-03-23
112
+
68
113
  ### Added
114
+
69
115
  - Headers will include by default an anchor tag (you can disable with `linkable_headers: false`)
70
116
 
71
117
  ### Changed
118
+
72
119
  - Fixed multiline blockquote delimiter
73
120
  - GitLab URL is not customizable with `gitlab_url: 'http://yourcustomgitlab.com'`
74
121
 
75
122
  ## [0.2.0] - 2018-03-19
123
+
76
124
  ### Added
77
- - Syntax highlighter uses ``` or ~~~
125
+
126
+ - Syntax highlighter uses `` ``` `` or `~~~`
78
127
 
79
128
  ### Changed
129
+
80
130
  - Requires Ruby 2.4
81
131
  - Requires rouge `~> 3.0`
82
132
 
83
133
  ## [0.1.0] - 2018-03-17
134
+
84
135
  ### Added
136
+
85
137
  - The initial version of the Gem
86
138
  - Special GitLab References
87
139
  - Multiline Blockquote
88
140
 
141
+ [0.14.0]: https://gitlab.com/gitlab-org/gitlab_kramdown/compare/v0.13.0...v0.14.0
142
+ [0.13.0]: https://gitlab.com/gitlab-org/gitlab_kramdown/compare/v0.12.0...v0.13.0
143
+ [0.12.0]: https://gitlab.com/gitlab-org/gitlab_kramdown/compare/v0.11.0...v0.12.0
144
+ [0.11.0]: https://gitlab.com/gitlab-org/gitlab_kramdown/compare/v0.10.0...v0.11.0
89
145
  [0.10.0]: https://gitlab.com/gitlab-org/gitlab_kramdown/compare/v0.9.0...v0.10.0
90
146
  [0.9.0]: https://gitlab.com/gitlab-org/gitlab_kramdown/compare/v0.8.0...v0.9.0
91
147
  [0.8.0]: https://gitlab.com/gitlab-org/gitlab_kramdown/compare/v0.7.0...v0.8.0
data/README.md CHANGED
@@ -37,8 +37,8 @@ This is a list of GitLab Flavored Markdown (GFM) extensions and their status of
37
37
  | :------------------| :------------------: | -------------------------------------------- |
38
38
  | `gitlab_url` | `https://gitlab.com` | GitLab instance URL to build reference links |
39
39
  | `linkable_headers` | true | Generate anchor tags with headers? |
40
- | `autolink` | false | Converts URLs to HTML links (can be slow) |
41
- | `clickable_images` | true | Autolink images to themselves |
40
+ | `autolink` | false | Converts URLs to HTML links (can be slow) |
41
+ | `clickable_images` | true | Autolink images to themselves |
42
42
 
43
43
  ## Usage example
44
44
 
@@ -71,20 +71,27 @@ To have also syntax highlighting using the same engine GitLab use, you need to d
71
71
  Kramdown::Document.new(source, input: 'GitlabKramdown', syntax_highlighter: :rouge).to_html
72
72
  ```
73
73
 
74
- ## Supported and tested Ruby versions:
74
+ ## Supported and tested Ruby versions
75
75
 
76
- - Ruby 2.5
77
- - Ruby 2.6
76
+ - Ruby 2.7
77
+
78
+ ## Release a new version
79
+
80
+ To release a new version of GitLab Kramdown:
81
+
82
+ 1. Update the `CHANGELOG.md` file for the new version.
83
+ 1. Check `lib/gitlab_kramdown/gitlab_kramdown.rb` is updated for the new version.
84
+ 1. Run `rake release`.
78
85
 
79
86
  ## Contributing to gitlab_kramdown
80
87
 
81
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
82
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
83
- * Fork the project.
84
- * Start a feature/bugfix branch.
85
- * Commit and push until you are happy with your contribution.
86
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
87
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version,
88
+ - Check out the `main` branch to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
89
+ - Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
90
+ - Fork the project.
91
+ - Start a feature/bugfix branch.
92
+ - Commit and push until you are happy with your contribution.
93
+ - Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
94
+ - Please try not to mess with the Rakefile, version, or history. If you want to have your own version,
88
95
  or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
89
96
 
90
97
  ## Copyright
@@ -29,9 +29,10 @@ module GitlabKramdown
29
29
  # Mermaid requires `<div class="mermaid"></div>` surrounding the content in order
30
30
  # to trigger the unobtrusive JS.
31
31
  def convert_codeblock(element, opts)
32
- if element.options[:lang] == 'mermaid'
32
+ case element.options[:lang]
33
+ when 'mermaid'
33
34
  %(<div class="mermaid">#{element.value}</div>\n)
34
- elsif element.options[:lang] == 'plantuml'
35
+ when 'plantuml'
35
36
  plantuml_setup
36
37
 
37
38
  img_tag = Nokogiri::HTML::DocumentFragment.parse(
@@ -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 = /\\([\\.*_+`<>()\[\]{}#!:|"'$=\-~])/.freeze
12
12
 
13
13
  def self.included(klass)
14
14
  klass.define_parser(:escape_chars_gitlab, ESCAPED_CHARS_GFM, '\\\\', :parse_escaped_chars)
@@ -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,}/.freeze
19
+ FENCED_CODEBLOCK_MATCH = /^ {0,3}(([~`]){3,})\s*?((\S+?)(?:\?\S*)?)?\s*?\n(.*?)^ {0,3}\1\2*\s*?\n/m.freeze
20
20
 
21
21
  def self.included(klass)
22
22
  klass.define_parser(:codeblock_fenced_gitlab, FENCED_CODEBLOCK_START, nil, 'parse_codeblock_fenced')
@@ -73,7 +73,7 @@ module GitlabKramdown
73
73
  end
74
74
 
75
75
  NON_WORD_RE = /[^\p{Word}\- \t]/.freeze
76
- MARKDOWN_LINK_TEXT = /\[(?<link_text>[^\]]+)\]\((?<link_url>[^\)]+)\)/.freeze
76
+ MARKDOWN_LINK_TEXT = /\[(?<link_text>[^\]]+)\]\((?<link_url>[^)]+)\)/.freeze
77
77
 
78
78
  def generate_header_id(text)
79
79
  result = text.downcase
@@ -9,7 +9,7 @@ module GitlabKramdown
9
9
  #
10
10
  # @see https://docs.gitlab.com/ee/user/markdown.html#special-gitlab-references
11
11
  module Reference
12
- PATH_REGEX = /[a-zA-Z0-9_\.][a-zA-Z0-9_\-\.]+/.freeze
12
+ PATH_REGEX = /[a-zA-Z0-9_.][a-zA-Z0-9_\-.]+/.freeze
13
13
 
14
14
  NAMESPACE_FORMAT_REGEX = %r{
15
15
  (?:#{PATH_REGEX}[a-zA-Z0-9_\-])
@@ -62,7 +62,7 @@ module GitlabKramdown
62
62
  (?<namespace>#{ALWAYS_FULL_NAMESPACE_FORMAT_REGEX})
63
63
  #{Regexp.escape('~')}
64
64
  (?<label>
65
- [A-Za-z0-9_\-\?\.&]+ | # String-based single-word label title, or
65
+ [A-Za-z0-9_\-?.&]+ | # String-based single-word label title, or
66
66
  ".+?" # String-based multi-word label surrounded in quotes
67
67
  )
68
68
  }x.freeze
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitlabKramdown
4
- VERSION = '0.10.0'
4
+ VERSION = '0.14.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.10.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Mazetto
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-27 00:00:00.000000000 Z
11
+ date: 2021-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown
@@ -16,168 +16,168 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.3.0
19
+ version: 2.3.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.3.0
26
+ version: 2.3.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rouge
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.2'
33
+ version: 3.26.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: '3.2'
40
+ version: 3.26.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.10.10
47
+ version: 1.12.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.10.10
54
+ version: 1.12.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: asciidoctor-plantuml
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.0.12
61
+ version: 0.0.14
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 0.0.12
68
+ version: 0.0.14
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '13.0'
75
+ version: 13.0.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.0'
82
+ version: 13.0.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.2'
89
+ version: 6.3.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.2'
96
+ version: 6.3.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: '1.0'
103
+ version: '2.1'
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: '1.0'
110
+ version: '2.1'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: simplecov
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: 0.21.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '0'
124
+ version: 0.21.0
125
125
  - !ruby/object:Gem::Dependency
126
- name: rubocop
126
+ name: gitlab-styles
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0'
131
+ version: 6.2.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: '0'
138
+ version: 6.2.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: '0'
145
+ version: 3.10.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: '0'
152
+ version: 3.10.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rspec_junit_formatter
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ">="
157
+ - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '0'
159
+ version: 0.4.0
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ">="
164
+ - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '0'
166
+ version: 0.4.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: benchmark-ips
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '2.7'
173
+ version: 2.9.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.7'
180
+ version: 2.9.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:
@@ -207,9 +207,9 @@ licenses:
207
207
  metadata:
208
208
  homepage_uri: https://gitlab.com/gitlab-org/gitlab_kramdown
209
209
  source_code_uri: https://gitlab.com/gitlab-org/gitlab_kramdown
210
- changelog_uri: https://gitlab.com/gitlab-org/gitlab_kramdown/blob/master/CHANGELOG.md
210
+ changelog_uri: https://gitlab.com/gitlab-org/gitlab_kramdown/blob/main/CHANGELOG.md
211
211
  bug_tracker_uri: https://gitlab.com/gitlab-org/gitlab_kramdown/-/issues
212
- post_install_message:
212
+ post_install_message:
213
213
  rdoc_options: []
214
214
  require_paths:
215
215
  - lib
@@ -217,15 +217,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
217
217
  requirements:
218
218
  - - ">="
219
219
  - !ruby/object:Gem::Version
220
- version: 2.5.0
220
+ version: 2.7.2
221
221
  required_rubygems_version: !ruby/object:Gem::Requirement
222
222
  requirements:
223
223
  - - ">="
224
224
  - !ruby/object:Gem::Version
225
225
  version: '0'
226
226
  requirements: []
227
- rubygems_version: 3.0.3
228
- signing_key:
227
+ rubygems_version: 3.2.15
228
+ signing_key:
229
229
  specification_version: 4
230
230
  summary: GitLab Flavored Kramdown
231
231
  test_files: []