gitlab_kramdown 0.16.0 → 0.19.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: 517b3887d49cee2247f49be6b18fa0cbb6c4c18e7af3665ba7ff5ef176a76605
4
- data.tar.gz: 59cde8e22215f041764f87129bea76d3437812c80514bd7aea9051766fc5662d
3
+ metadata.gz: 663f957325c534dd39902b3b7c12b07ec3af79c2966c70225d5c0c757a5be5da
4
+ data.tar.gz: 6f563942a5b3b50a6e7b5eeffc8e309ec7c4723baf57cdc1af32322e2c90cf92
5
5
  SHA512:
6
- metadata.gz: 4aabf0787861f334bf0e500a49ef9cd678beae3a3fba429d772df8e100b99980d9951e302c0e6a1d6502e8594671391841cdfcfba46f5c4e4500ec643eb2b3d7
7
- data.tar.gz: 96ea79c38638a5f800dd457c904114179a2ab4bf478bd6aa2e3b9cb4db37227e12ce363d73e38c215de6fe6c5d2a7e82dd164b2b5c40c8cda42b0f073b0e0c67
6
+ metadata.gz: b6742e50ebf1133157760b5172dbcc592eccf84d95215223467fe964f3825bef6cc5b8115fa95381625ea6b8608b6ca38ae4ef6ed803d061315223ab96973653
7
+ data.tar.gz: 52cd4e89baf32823897dce46690a1a9da146ea0861806829c6a58ad58bef69ad6d793314ad99447dc9d882764d4b29a4fd0b4fb341a6bd7e8d8a24ffc754a45b
data/CHANGELOG.md CHANGED
@@ -7,7 +7,25 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [0.16.0] - 2022-24-01
10
+ ## [0.19.0] - 2022-04-26
11
+
12
+ ### Changes
13
+
14
+ - Update Bundler and other Gem dependencies.
15
+
16
+ ## [0.18.0] - 2022-03-11
17
+
18
+ ### Changes
19
+
20
+ - Update Gem dependencies.
21
+
22
+ ## [0.17.0] - 2022-02-10
23
+
24
+ ### Added
25
+
26
+ - Add support for making PlantUML images a clickable link
27
+
28
+ ## [0.16.0] - 2022-01-24
11
29
 
12
30
  ### Fixed
13
31
 
@@ -21,19 +39,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
21
39
 
22
40
  ## [0.15.0] - 2021-12-20
23
41
 
24
- ### Changes
42
+ ### Changed
25
43
 
26
44
  - Update Gem dependencies.
27
45
 
28
46
  ## [0.14.0] - 2021-08-10
29
47
 
30
- ### Changes
48
+ ### Changed
31
49
 
32
50
  - Update Gem dependencies. In particular, update Nokogiri to version 1.12.x.
33
51
 
34
52
  ## [0.13.0] - 2021-07-02
35
53
 
36
- ### Changes
54
+ ### Changed
37
55
 
38
56
  - Update Gem dependencies
39
57
 
data/README.md CHANGED
@@ -7,25 +7,25 @@ CommonMark with extensions implemented inside the Rails application.
7
7
 
8
8
  ## GitLab Flavored Markdown extensions support
9
9
 
10
- This is a list of GitLab Flavored Markdown (GFM) extensions and their status of support on this gem:
11
-
12
- | GFM Extensions | Implemented? |
13
- |---------------------------------|--------------|
14
- | [Newlines] | No |
15
- | [Multiple underscores in words] | _Kramdown_ |
16
- | [Headers with Anchors] | **Yes** |
17
- | [URL auto-linking] | **Yes** |
18
- | [Multiline Blockquote] | **Yes** |
19
- | [Code and Syntax Highlighting] | **Yes** |
20
- | [Strikethrough] | **Yes** |
21
- | [Inline Diff] | No |
22
- | [Emoji] | No |
23
- | [Special GitLab references] | **Yes** |
24
- | [Task Lists] | No |
25
- | [Videos] | No |
26
- | [Math] | No |
27
- | [Colors] | No |
28
- | [Mermaid] | **Yes** |
10
+ This is a list of GitLab Flavored Markdown (GLFM) extensions and their status of support on this gem:
11
+
12
+ | GLFM Extensions | Implemented? |
13
+ |--------------------------------- |--------------|
14
+ | [Newlines] | No |
15
+ | [Multiple underscores in words] | _Kramdown_ |
16
+ | [Headers with Anchors] | **Yes** |
17
+ | [URL auto-linking] | **Yes** |
18
+ | [Multiline Blockquote] | **Yes** |
19
+ | [Code and Syntax Highlighting] | **Yes** |
20
+ | [Strikethrough] | **Yes** |
21
+ | [Inline Diff] | No |
22
+ | [Emoji] | No |
23
+ | [Special GitLab references] | **Yes** |
24
+ | [Task Lists] | No |
25
+ | [Videos] | No |
26
+ | [Math] | No |
27
+ | [Colors] | No |
28
+ | [Mermaid] | **Yes** |
29
29
  | [PlantUML] | **Yes** |
30
30
 
31
31
  > **Note**: Extensions marked as `Kramdown` in the `Implemented?` means behavior already exists
@@ -50,7 +50,7 @@ require 'kramdown'
50
50
  require 'gitlab_kramdown'
51
51
 
52
52
  source = <<-EOF
53
- # GFM example
53
+ # GLFM example
54
54
 
55
55
  We support custom extensions like:
56
56
 
@@ -33,13 +33,7 @@ module GitlabKramdown
33
33
  when 'mermaid'
34
34
  %(<div class="mermaid">#{element.value}</div>\n)
35
35
  when 'plantuml'
36
- plantuml_setup
37
-
38
- img_tag = Nokogiri::HTML::DocumentFragment.parse(
39
- Asciidoctor::PlantUml::Processor.plantuml_content(element.value, {})
40
- )
41
-
42
- %(#{img_tag}\n)
36
+ render_plantuml(element)
43
37
  else
44
38
  super
45
39
  end
@@ -66,7 +60,7 @@ module GitlabKramdown
66
60
 
67
61
  href = element.attr['src']
68
62
 
69
- %(<a href="#{href}" target="_blank" rel="noopener noreferrer">#{super}</a>)
63
+ img_with_clickable_link(href, super)
70
64
  end
71
65
 
72
66
  # Label element is generated by the GitlabKramdown parser, representing GitLab labels
@@ -83,6 +77,26 @@ module GitlabKramdown
83
77
 
84
78
  format_as_span_html(:a, { 'href' => element.attr['href'] }, span_tag)
85
79
  end
80
+
81
+ def img_with_clickable_link(href, img_html)
82
+ %(<a class="no-attachment-icon" href="#{href}" target="_blank" rel="noopener noreferrer">#{img_html}</a>)
83
+ end
84
+
85
+ def render_plantuml(element)
86
+ plantuml_setup
87
+
88
+ img_tag = Nokogiri::HTML::DocumentFragment.parse(
89
+ Asciidoctor::PlantUml::Processor.plantuml_content(element.value, {})
90
+ )
91
+
92
+ if @clickable_images
93
+ href = img_tag.at('img').attr('src')
94
+
95
+ "#{img_with_clickable_link(href, img_tag)}\n"
96
+ else
97
+ %(#{img_tag}\n)
98
+ end
99
+ end
86
100
  end
87
101
  end
88
102
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitlabKramdown
4
- VERSION = '0.16.0'
4
+ VERSION = '0.19.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.16.0
4
+ version: 0.19.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: 2022-01-24 00:00:00.000000000 Z
11
+ date: 2022-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.3.1
19
+ version: 2.3.0
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.1
26
+ version: 2.3.0
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.27.0
33
+ version: 3.28.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.27.0
40
+ version: 3.28.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.12.0
47
+ version: 1.13.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.12.0
54
+ version: 1.13.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: asciidoctor-plantuml
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -86,28 +86,28 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 6.3.0
89
+ version: 6.4.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.3.0
96
+ version: 6.4.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.1'
103
+ version: '2.3'
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.1'
110
+ version: '2.3'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: simplecov
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -128,56 +128,56 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 6.6.0
131
+ version: 7.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: 6.6.0
138
+ version: 7.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.10.0
145
+ version: 3.11.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.10.0
152
+ version: 3.11.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.4.0
159
+ version: 0.5.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.4.0
166
+ version: 0.5.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.9.0
173
+ version: 2.10.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.9.0
180
+ version: 2.10.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:
@@ -202,14 +202,14 @@ files:
202
202
  - lib/gitlab_kramdown/parser/strikethrough.rb
203
203
  - lib/gitlab_kramdown/version.rb
204
204
  - lib/kramdown/parser/gitlab_kramdown.rb
205
- homepage: https://gitlab.com/gitlab-org/gitlab_kramdown
205
+ homepage: https://gitlab.com/gitlab-org/ruby/gems/gitlab_kramdown
206
206
  licenses:
207
207
  - MIT
208
208
  metadata:
209
- homepage_uri: https://gitlab.com/gitlab-org/gitlab_kramdown
210
- source_code_uri: https://gitlab.com/gitlab-org/gitlab_kramdown
211
- changelog_uri: https://gitlab.com/gitlab-org/gitlab_kramdown/blob/main/CHANGELOG.md
212
- bug_tracker_uri: https://gitlab.com/gitlab-org/gitlab_kramdown/-/issues
209
+ homepage_uri: https://gitlab.com/gitlab-org/ruby/gems/gitlab_kramdown
210
+ source_code_uri: https://gitlab.com/gitlab-org/ruby/gems/gitlab_kramdown
211
+ changelog_uri: https://gitlab.com/gitlab-org/ruby/gems/gitlab_kramdown/blob/main/CHANGELOG.md
212
+ bug_tracker_uri: https://gitlab.com/gitlab-org/ruby/gems/gitlab_kramdown/-/issues
213
213
  post_install_message:
214
214
  rdoc_options: []
215
215
  require_paths: