gitlab_kramdown 0.10.0 → 0.11.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 +37 -3
- data/README.md +4 -5
- data/lib/gitlab_kramdown/converter/gitlab_html.rb +3 -2
- data/lib/gitlab_kramdown/parser/escape.rb +1 -1
- data/lib/gitlab_kramdown/parser/fenced_codeblock.rb +2 -2
- data/lib/gitlab_kramdown/parser/header.rb +1 -1
- data/lib/gitlab_kramdown/parser/reference.rb +2 -2
- data/lib/gitlab_kramdown/version.rb +1 -1
- metadata +34 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cb65c38f5c2b3874971ea5d06871cd88e66461665292431117b24800319f9e8
|
4
|
+
data.tar.gz: 1824f2bb612c8b161231646161bb2c9e05f167fbc2d3879d6a5701bdc1e194b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be2d78979f965235916159f56fe2c33be32d71f749cc7028542b462e7664879f2796a4824ad6b1ac8c87b4ce0a4702d433d6c17f41509064d43693a9f52bb74a
|
7
|
+
data.tar.gz: abc999da7070bcd89bc807453d430cfa2dcf02a2fa866fa12ab3886454edb52d88a2fd40b2e66d3416a084eafa4decb4ebd007459a26b4bc6745582e666820e9
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.11.0] - 2021-01-25
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
|
13
|
+
- Update Gem dependencies.
|
14
|
+
- Update minimum required Ruby to 2.7.x.
|
15
|
+
|
9
16
|
## [0.10.0] - 2020-08-27
|
10
17
|
|
11
18
|
- Update Gem dependencies
|
@@ -13,79 +20,106 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
13
20
|
## [0.9.0] - 2019-10-17
|
14
21
|
|
15
22
|
### Fixed
|
23
|
+
|
16
24
|
- Fix very long IDs for headers that include links.
|
17
25
|
|
18
26
|
### Added
|
27
|
+
|
19
28
|
- Images should be clickable and linked to itself
|
20
29
|
- Clickable images behavior is configurable
|
21
30
|
|
22
|
-
|
31
|
+
## [0.8.0] - 2019-10-14
|
23
32
|
|
24
33
|
### Changed
|
34
|
+
|
25
35
|
- Revert "Fix very long IDs for headers that include links"
|
26
36
|
|
27
|
-
|
37
|
+
## [0.7.0] - 2019-10-11
|
28
38
|
|
29
39
|
### Added
|
40
|
+
|
30
41
|
- Add support for PlantUML
|
31
42
|
|
32
43
|
### Changed
|
44
|
+
|
33
45
|
- Ruby 2.4 support is dropped.
|
34
46
|
- Fix very long IDs for headers that include links.
|
35
47
|
|
36
48
|
## [0.6.0] - 2019-05-07
|
49
|
+
|
37
50
|
### Changed
|
51
|
+
|
38
52
|
- URL Autolinks are now disabled by default (you can re-enable with `autolink: true` configuration param)
|
39
53
|
|
40
54
|
### Added
|
55
|
+
|
41
56
|
- Added support for rendering Mermaid when their JS is available
|
42
57
|
|
43
58
|
## [0.5.0] - 2019-04-09
|
59
|
+
|
44
60
|
### Added
|
61
|
+
|
45
62
|
- Strikethrough support
|
46
63
|
|
47
64
|
## [0.4.2] - 2018-11-21
|
65
|
+
|
48
66
|
### Changed
|
67
|
+
|
49
68
|
- URL autolinks will not execute inside `[]()` or `[]` blocks
|
50
69
|
- Freezing `kramdown` version to allow only patchlevel changes
|
51
70
|
|
52
71
|
## [0.4.1] - 2018-11-02
|
72
|
+
|
53
73
|
### Added
|
74
|
+
|
54
75
|
- Codebase now have a benchmark utility to compare with plain Kramdown
|
55
76
|
|
56
77
|
### Changed
|
78
|
+
|
57
79
|
- Many performance improvements on existing RegExp rules
|
58
80
|
- Improve gemspec metadata and include only needed files on gem
|
59
81
|
|
60
82
|
## [0.4.0] - 2018-04-12
|
83
|
+
|
61
84
|
### Added
|
85
|
+
|
62
86
|
- URL auto-linking support
|
63
87
|
|
64
88
|
### Changed
|
89
|
+
|
65
90
|
- Fixed many inconsistencies in references autolink
|
66
91
|
|
67
92
|
## [0.3.0] - 2018-03-23
|
93
|
+
|
68
94
|
### Added
|
95
|
+
|
69
96
|
- Headers will include by default an anchor tag (you can disable with `linkable_headers: false`)
|
70
97
|
|
71
98
|
### Changed
|
99
|
+
|
72
100
|
- Fixed multiline blockquote delimiter
|
73
101
|
- GitLab URL is not customizable with `gitlab_url: 'http://yourcustomgitlab.com'`
|
74
102
|
|
75
103
|
## [0.2.0] - 2018-03-19
|
104
|
+
|
76
105
|
### Added
|
77
|
-
|
106
|
+
|
107
|
+
- Syntax highlighter uses `` ``` `` or `~~~`
|
78
108
|
|
79
109
|
### Changed
|
110
|
+
|
80
111
|
- Requires Ruby 2.4
|
81
112
|
- Requires rouge `~> 3.0`
|
82
113
|
|
83
114
|
## [0.1.0] - 2018-03-17
|
115
|
+
|
84
116
|
### Added
|
117
|
+
|
85
118
|
- The initial version of the Gem
|
86
119
|
- Special GitLab References
|
87
120
|
- Multiline Blockquote
|
88
121
|
|
122
|
+
[0.11.0]: https://gitlab.com/gitlab-org/gitlab_kramdown/compare/v0.10.0...v0.11.0
|
89
123
|
[0.10.0]: https://gitlab.com/gitlab-org/gitlab_kramdown/compare/v0.9.0...v0.10.0
|
90
124
|
[0.9.0]: https://gitlab.com/gitlab-org/gitlab_kramdown/compare/v0.8.0...v0.9.0
|
91
125
|
[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,10 +71,9 @@ 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.
|
77
|
-
- Ruby 2.6
|
76
|
+
- Ruby 2.7
|
78
77
|
|
79
78
|
## Contributing to gitlab_kramdown
|
80
79
|
|
@@ -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
|
-
|
32
|
+
case element.options[:lang]
|
33
|
+
when 'mermaid'
|
33
34
|
%(<div class="mermaid">#{element.value}</div>\n)
|
34
|
-
|
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 = /\\([\\.*_+`<>()\[\]{}
|
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 = /^
|
19
|
-
FENCED_CODEBLOCK_MATCH = /^
|
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>[
|
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_
|
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_
|
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
|
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.11.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: 2021-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|
@@ -30,154 +30,154 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
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:
|
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.
|
47
|
+
version: 1.11.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.11.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.
|
61
|
+
version: 0.0.13
|
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.
|
68
|
+
version: 0.0.13
|
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:
|
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:
|
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:
|
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:
|
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:
|
103
|
+
version: 2.1.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:
|
110
|
+
version: 2.1.0
|
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:
|
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:
|
124
|
+
version: 0.21.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rubocop
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - "
|
129
|
+
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: 1.8.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: 1.8.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:
|
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:
|
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:
|
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:
|
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:
|
173
|
+
version: 2.8.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:
|
180
|
+
version: 2.8.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:
|
@@ -217,14 +217,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
217
217
|
requirements:
|
218
218
|
- - ">="
|
219
219
|
- !ruby/object:Gem::Version
|
220
|
-
version: 2.
|
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.
|
227
|
+
rubygems_version: 3.1.4
|
228
228
|
signing_key:
|
229
229
|
specification_version: 4
|
230
230
|
summary: GitLab Flavored Kramdown
|