gitlab-glfm-markdown 0.0.38-x86_64-linux-gnu → 0.0.40-x86_64-linux-gnu
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Cargo.lock +5 -5
- data/README.md +11 -9
- data/ext/{glfm_markdown → gitlab_glfm_markdown}/Cargo.lock +5 -5
- data/ext/{glfm_markdown → gitlab_glfm_markdown}/Cargo.toml +4 -4
- data/ext/{glfm_markdown → gitlab_glfm_markdown}/extconf.rb +1 -1
- data/ext/gitlab_glfm_markdown/src/formatter.rs +456 -0
- data/ext/{glfm_markdown → gitlab_glfm_markdown}/src/glfm.rs +17 -32
- data/ext/{glfm_markdown → gitlab_glfm_markdown}/src/main.rs +44 -41
- data/lib/{glfm_markdown.rb → gitlab-glfm-markdown.rb} +3 -5
- data/lib/gitlab_glfm_markdown/3.1/gitlab_glfm_markdown.so +0 -0
- data/lib/gitlab_glfm_markdown/3.2/gitlab_glfm_markdown.so +0 -0
- data/lib/gitlab_glfm_markdown/3.3/gitlab_glfm_markdown.so +0 -0
- data/lib/gitlab_glfm_markdown/3.4/gitlab_glfm_markdown.so +0 -0
- data/lib/{glfm_markdown → gitlab_glfm_markdown}/loader.rb +2 -2
- data/lib/{glfm_markdown → gitlab_glfm_markdown}/version.rb +1 -1
- metadata +16 -16
- data/ext/glfm_markdown/src/formatter.rs +0 -366
- data/lib/glfm_markdown/3.1/glfm_markdown.so +0 -0
- data/lib/glfm_markdown/3.2/glfm_markdown.so +0 -0
- data/lib/glfm_markdown/3.3/glfm_markdown.so +0 -0
- data/lib/glfm_markdown/3.4/glfm_markdown.so +0 -0
- /data/ext/{glfm_markdown → gitlab_glfm_markdown}/src/lib.rs +0 -0
|
@@ -10,6 +10,8 @@ pub struct RenderOptions {
|
|
|
10
10
|
pub alerts: bool,
|
|
11
11
|
pub autolink: bool,
|
|
12
12
|
pub cjk_friendly_emphasis: bool,
|
|
13
|
+
/// Only use default comrak HTML formatting
|
|
14
|
+
pub default_html: bool,
|
|
13
15
|
// pub default_info_string: String,
|
|
14
16
|
pub description_lists: bool,
|
|
15
17
|
pub escape: bool,
|
|
@@ -23,16 +25,27 @@ pub struct RenderOptions {
|
|
|
23
25
|
pub github_pre_lang: bool,
|
|
24
26
|
pub greentext: bool,
|
|
25
27
|
pub hardbreaks: bool,
|
|
28
|
+
/// Use new header/anchor combination in HTML output, per
|
|
29
|
+
/// https://gitlab.com/gitlab-org/ruby/gems/gitlab-glfm-markdown/-/merge_requests/112.
|
|
30
|
+
pub header_accessibility: bool,
|
|
26
31
|
pub header_ids: Option<String>,
|
|
27
32
|
pub ignore_empty_links: bool,
|
|
28
33
|
pub ignore_setext: bool,
|
|
34
|
+
/// Detect inapplicable tasks (`- [~]`)
|
|
35
|
+
pub inapplicable_tasks: bool,
|
|
29
36
|
pub math_code: bool,
|
|
30
37
|
pub math_dollars: bool,
|
|
31
38
|
pub multiline_block_quotes: bool,
|
|
39
|
+
/// When the 'escaped_char_spans' render option is enabled, only emit `<span
|
|
40
|
+
/// data-escaped-char>` around the given characters.
|
|
41
|
+
pub only_escape_chars: Option<Vec<char>>,
|
|
42
|
+
/// Detect and mark potential placeholder variables, which
|
|
43
|
+
/// have the format `%{PLACEHOLDER}`
|
|
44
|
+
pub placeholder_detection: bool,
|
|
32
45
|
pub relaxed_autolinks: bool,
|
|
33
46
|
pub relaxed_tasklist_character: bool,
|
|
34
|
-
pub sourcepos: bool,
|
|
35
47
|
pub smart: bool,
|
|
48
|
+
pub sourcepos: bool,
|
|
36
49
|
pub spoiler: bool,
|
|
37
50
|
pub strikethrough: bool,
|
|
38
51
|
pub subscript: bool,
|
|
@@ -42,40 +55,11 @@ pub struct RenderOptions {
|
|
|
42
55
|
pub tagfilter: bool,
|
|
43
56
|
pub tasklist: bool,
|
|
44
57
|
pub tasklist_classes: bool,
|
|
58
|
+
pub tasklist_in_table: bool,
|
|
45
59
|
pub underline: bool,
|
|
46
60
|
pub r#unsafe: bool,
|
|
47
61
|
pub wikilinks_title_after_pipe: bool,
|
|
48
62
|
pub wikilinks_title_before_pipe: bool,
|
|
49
|
-
|
|
50
|
-
/// GLFM specific options
|
|
51
|
-
|
|
52
|
-
/// Only use default comrak HTML formatting
|
|
53
|
-
pub default_html: bool,
|
|
54
|
-
|
|
55
|
-
/// Detect inapplicable tasks (`- [~]`)
|
|
56
|
-
pub inapplicable_tasks: bool,
|
|
57
|
-
|
|
58
|
-
/// Detect and mark potential placeholder variables, which
|
|
59
|
-
/// have the format `%{PLACEHOLDER}`
|
|
60
|
-
pub placeholder_detection: bool,
|
|
61
|
-
|
|
62
|
-
/// When the 'escaped_char_spans' render option is enabled, only emit `<span
|
|
63
|
-
/// data-escaped-char>` around the given characters.
|
|
64
|
-
pub only_escape_chars: Option<Vec<char>>,
|
|
65
|
-
|
|
66
|
-
pub debug: bool,
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
impl From<&RenderOptions> for RenderUserData {
|
|
70
|
-
fn from(options: &RenderOptions) -> Self {
|
|
71
|
-
RenderUserData {
|
|
72
|
-
default_html: options.default_html,
|
|
73
|
-
inapplicable_tasks: options.inapplicable_tasks,
|
|
74
|
-
placeholder_detection: options.placeholder_detection,
|
|
75
|
-
only_escape_chars: options.only_escape_chars.clone(),
|
|
76
|
-
debug: options.debug,
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
63
|
}
|
|
80
64
|
|
|
81
65
|
impl From<&RenderOptions> for comrak::Options<'_> {
|
|
@@ -120,10 +104,11 @@ impl From<&RenderOptions> for comrak::Options<'_> {
|
|
|
120
104
|
comrak_options.render.r#unsafe = options.r#unsafe;
|
|
121
105
|
|
|
122
106
|
// comrak_options.parse.default_info_string = options.default_info_string;
|
|
107
|
+
comrak_options.parse.ignore_setext = options.ignore_setext;
|
|
123
108
|
comrak_options.parse.relaxed_autolinks = options.relaxed_autolinks;
|
|
124
109
|
comrak_options.parse.relaxed_tasklist_matching = options.relaxed_tasklist_character;
|
|
125
110
|
comrak_options.parse.smart = options.smart;
|
|
126
|
-
comrak_options.parse.
|
|
111
|
+
comrak_options.parse.tasklist_in_table = options.tasklist_in_table;
|
|
127
112
|
|
|
128
113
|
comrak_options
|
|
129
114
|
}
|
|
@@ -14,6 +14,10 @@ struct Args {
|
|
|
14
14
|
#[arg(value_name = "FILE")]
|
|
15
15
|
file: Option<String>,
|
|
16
16
|
|
|
17
|
+
/// Write output to FILE instead of stdout
|
|
18
|
+
#[arg(short, long, value_name = "FILE")]
|
|
19
|
+
output: Option<String>,
|
|
20
|
+
|
|
17
21
|
/// Enable 'alerts' extension
|
|
18
22
|
#[arg(long)]
|
|
19
23
|
alerts: bool,
|
|
@@ -22,6 +26,14 @@ struct Args {
|
|
|
22
26
|
#[arg(long)]
|
|
23
27
|
autolink: bool,
|
|
24
28
|
|
|
29
|
+
/// Enable 'cjk_friendly_emphasis' extension
|
|
30
|
+
#[arg(long)]
|
|
31
|
+
cjk_friendly_emphasis: bool,
|
|
32
|
+
|
|
33
|
+
/// Only use default comrak HTML formatting
|
|
34
|
+
#[arg(long)]
|
|
35
|
+
default_html: bool,
|
|
36
|
+
|
|
25
37
|
/// Enable 'description-lists' extension
|
|
26
38
|
#[arg(long)]
|
|
27
39
|
description_lists: bool,
|
|
@@ -72,6 +84,11 @@ struct Args {
|
|
|
72
84
|
#[arg(long)]
|
|
73
85
|
hardbreaks: bool,
|
|
74
86
|
|
|
87
|
+
/// Use new header/anchor combination in HTML output, per
|
|
88
|
+
/// https://gitlab.com/gitlab-org/ruby/gems/gitlab-glfm-markdown/-/merge_requests/112.
|
|
89
|
+
#[arg(long)]
|
|
90
|
+
header_accessibility: bool,
|
|
91
|
+
|
|
75
92
|
/// Enable the 'header IDs' extension, with the given ID prefix
|
|
76
93
|
#[arg(long, value_name = "PREFIX")]
|
|
77
94
|
header_ids: Option<String>,
|
|
@@ -84,6 +101,10 @@ struct Args {
|
|
|
84
101
|
#[arg(long)]
|
|
85
102
|
ignore_setext: bool,
|
|
86
103
|
|
|
104
|
+
/// Detect inapplicable tasks (`- [~]`)
|
|
105
|
+
#[arg(long)]
|
|
106
|
+
inapplicable_tasks: bool,
|
|
107
|
+
|
|
87
108
|
/// Enables `math code` extension, using math code syntax
|
|
88
109
|
#[arg(long)]
|
|
89
110
|
math_code: bool,
|
|
@@ -96,9 +117,15 @@ struct Args {
|
|
|
96
117
|
#[arg(long)]
|
|
97
118
|
multiline_block_quotes: bool,
|
|
98
119
|
|
|
99
|
-
///
|
|
100
|
-
|
|
101
|
-
|
|
120
|
+
/// When the 'escaped_char_spans' render option is enabled, only emit `<span
|
|
121
|
+
/// data-escaped-char>` around the characters in the supplied string.
|
|
122
|
+
#[arg(long)]
|
|
123
|
+
only_escape_chars: Option<String>,
|
|
124
|
+
|
|
125
|
+
/// Detect and marks potential placeholder variables, which
|
|
126
|
+
/// have the format `%{PLACEHOLDER}`
|
|
127
|
+
#[arg(long)]
|
|
128
|
+
placeholder_detection: bool,
|
|
102
129
|
|
|
103
130
|
/// Enable relaxing of autolink parsing, allowing links to be recognized when in brackets
|
|
104
131
|
#[arg(long)]
|
|
@@ -108,14 +135,14 @@ struct Args {
|
|
|
108
135
|
#[arg(long)]
|
|
109
136
|
relaxed_tasklist_character: bool,
|
|
110
137
|
|
|
111
|
-
/// Include source mappings in HTML attributes
|
|
112
|
-
#[arg(long)]
|
|
113
|
-
sourcepos: bool,
|
|
114
|
-
|
|
115
138
|
/// Use smart punctuation
|
|
116
139
|
#[arg(long)]
|
|
117
140
|
smart: bool,
|
|
118
141
|
|
|
142
|
+
/// Include source mappings in HTML attributes
|
|
143
|
+
#[arg(long)]
|
|
144
|
+
sourcepos: bool,
|
|
145
|
+
|
|
119
146
|
/// Enables spoilers using double vertical bars
|
|
120
147
|
#[arg(long)]
|
|
121
148
|
spoiler: bool,
|
|
@@ -152,6 +179,10 @@ struct Args {
|
|
|
152
179
|
#[arg(long)]
|
|
153
180
|
tasklist_classes: bool,
|
|
154
181
|
|
|
182
|
+
/// Enables parsing tasklist items within tables when they're the only content of a table cell
|
|
183
|
+
#[arg(long)]
|
|
184
|
+
tasklist_in_table: bool,
|
|
185
|
+
|
|
155
186
|
/// Enables underlines using double underscores
|
|
156
187
|
#[arg(long)]
|
|
157
188
|
underline: bool,
|
|
@@ -167,34 +198,6 @@ struct Args {
|
|
|
167
198
|
/// Enable 'wikilink_title_before_pipe' extension
|
|
168
199
|
#[arg(long)]
|
|
169
200
|
wikilinks_title_before_pipe: bool,
|
|
170
|
-
|
|
171
|
-
/// Only use default comrak HTML formatting
|
|
172
|
-
#[arg(long)]
|
|
173
|
-
default_html: bool,
|
|
174
|
-
|
|
175
|
-
/// GLFM specific options
|
|
176
|
-
|
|
177
|
-
/// Detect inapplicable tasks (`- [~]`)
|
|
178
|
-
#[arg(long)]
|
|
179
|
-
inapplicable_tasks: bool,
|
|
180
|
-
|
|
181
|
-
/// Detect and marks potential placeholder variables, which
|
|
182
|
-
/// have the format `%{PLACEHOLDER}`
|
|
183
|
-
#[arg(long)]
|
|
184
|
-
placeholder_detection: bool,
|
|
185
|
-
|
|
186
|
-
/// When the 'escaped_char_spans' render option is enabled, only emit `<span
|
|
187
|
-
/// data-escaped-char>` around the characters in the supplied string.
|
|
188
|
-
#[arg(long)]
|
|
189
|
-
only_escape_chars: Option<String>,
|
|
190
|
-
|
|
191
|
-
/// Enable 'cjk_friendly_emphasis' extension
|
|
192
|
-
#[arg(long)]
|
|
193
|
-
cjk_friendly_emphasis: bool,
|
|
194
|
-
|
|
195
|
-
/// Show debug information
|
|
196
|
-
#[arg(long)]
|
|
197
|
-
debug: bool,
|
|
198
201
|
}
|
|
199
202
|
|
|
200
203
|
fn main() {
|
|
@@ -216,6 +219,7 @@ fn main() {
|
|
|
216
219
|
autolink: cli.autolink,
|
|
217
220
|
cjk_friendly_emphasis: cli.cjk_friendly_emphasis,
|
|
218
221
|
// default_info_string:
|
|
222
|
+
default_html: cli.default_html,
|
|
219
223
|
description_lists: cli.description_lists,
|
|
220
224
|
escape: cli.escape,
|
|
221
225
|
escaped_char_spans: cli.escaped_char_spans,
|
|
@@ -228,6 +232,7 @@ fn main() {
|
|
|
228
232
|
github_pre_lang: cli.github_pre_lang,
|
|
229
233
|
greentext: cli.greentext,
|
|
230
234
|
hardbreaks: cli.hardbreaks,
|
|
235
|
+
header_accessibility: cli.header_accessibility,
|
|
231
236
|
header_ids: cli.header_ids,
|
|
232
237
|
ignore_empty_links: cli.ignore_empty_links,
|
|
233
238
|
ignore_setext: cli.ignore_setext,
|
|
@@ -235,10 +240,12 @@ fn main() {
|
|
|
235
240
|
math_code: cli.math_code,
|
|
236
241
|
math_dollars: cli.math_dollars,
|
|
237
242
|
multiline_block_quotes: cli.multiline_block_quotes,
|
|
243
|
+
only_escape_chars: cli.only_escape_chars.map(|s| s.chars().collect()),
|
|
244
|
+
placeholder_detection: cli.placeholder_detection,
|
|
238
245
|
relaxed_autolinks: cli.relaxed_autolinks,
|
|
239
246
|
relaxed_tasklist_character: cli.relaxed_tasklist_character,
|
|
240
|
-
sourcepos: cli.sourcepos,
|
|
241
247
|
smart: cli.smart,
|
|
248
|
+
sourcepos: cli.sourcepos,
|
|
242
249
|
spoiler: cli.spoiler,
|
|
243
250
|
strikethrough: cli.strikethrough,
|
|
244
251
|
subscript: cli.subscript,
|
|
@@ -248,15 +255,11 @@ fn main() {
|
|
|
248
255
|
tagfilter: cli.tagfilter,
|
|
249
256
|
tasklist: cli.tasklist,
|
|
250
257
|
tasklist_classes: cli.tasklist_classes,
|
|
258
|
+
tasklist_in_table: cli.tasklist_in_table,
|
|
251
259
|
underline: cli.underline,
|
|
252
260
|
r#unsafe: cli.r#unsafe,
|
|
253
261
|
wikilinks_title_after_pipe: cli.wikilinks_title_after_pipe,
|
|
254
262
|
wikilinks_title_before_pipe: cli.wikilinks_title_before_pipe,
|
|
255
|
-
|
|
256
|
-
default_html: cli.default_html,
|
|
257
|
-
placeholder_detection: cli.placeholder_detection,
|
|
258
|
-
only_escape_chars: cli.only_escape_chars.map(|s| s.chars().collect()),
|
|
259
|
-
debug: cli.debug,
|
|
260
263
|
};
|
|
261
264
|
|
|
262
265
|
let result = render(&source, &options);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative '
|
|
4
|
-
require_relative '
|
|
3
|
+
require_relative 'gitlab_glfm_markdown/version'
|
|
4
|
+
require_relative 'gitlab_glfm_markdown/loader'
|
|
5
5
|
|
|
6
6
|
load_rust_extension
|
|
7
7
|
|
|
@@ -27,9 +27,7 @@ module GLFMMarkdown
|
|
|
27
27
|
tagfilter: false,
|
|
28
28
|
tasklist: true,
|
|
29
29
|
tasklist_classes: true,
|
|
30
|
-
unsafe: true
|
|
31
|
-
|
|
32
|
-
debug: false
|
|
30
|
+
unsafe: true
|
|
33
31
|
}.freeze
|
|
34
32
|
|
|
35
33
|
class << self
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
def load_rust_extension
|
|
4
4
|
ruby_version = /(\d+\.\d+)/.match(RUBY_VERSION)
|
|
5
|
-
require "
|
|
5
|
+
require "gitlab_glfm_markdown/#{ruby_version}/gitlab_glfm_markdown"
|
|
6
6
|
rescue LoadError
|
|
7
|
-
require '
|
|
7
|
+
require 'gitlab_glfm_markdown/gitlab_glfm_markdown'
|
|
8
8
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gitlab-glfm-markdown
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.40
|
|
5
5
|
platform: x86_64-linux-gnu
|
|
6
6
|
authors:
|
|
7
7
|
- Brett Walker
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2025-10
|
|
12
|
+
date: 2025-12-10 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rb_sys
|
|
@@ -64,20 +64,20 @@ files:
|
|
|
64
64
|
- Cargo.lock
|
|
65
65
|
- LICENSE
|
|
66
66
|
- README.md
|
|
67
|
-
- ext/
|
|
68
|
-
- ext/
|
|
69
|
-
- ext/
|
|
70
|
-
- ext/
|
|
71
|
-
- ext/
|
|
72
|
-
- ext/
|
|
73
|
-
- ext/
|
|
74
|
-
- lib/
|
|
75
|
-
- lib/
|
|
76
|
-
- lib/
|
|
77
|
-
- lib/
|
|
78
|
-
- lib/
|
|
79
|
-
- lib/
|
|
80
|
-
- lib/
|
|
67
|
+
- ext/gitlab_glfm_markdown/Cargo.lock
|
|
68
|
+
- ext/gitlab_glfm_markdown/Cargo.toml
|
|
69
|
+
- ext/gitlab_glfm_markdown/extconf.rb
|
|
70
|
+
- ext/gitlab_glfm_markdown/src/formatter.rs
|
|
71
|
+
- ext/gitlab_glfm_markdown/src/glfm.rs
|
|
72
|
+
- ext/gitlab_glfm_markdown/src/lib.rs
|
|
73
|
+
- ext/gitlab_glfm_markdown/src/main.rs
|
|
74
|
+
- lib/gitlab-glfm-markdown.rb
|
|
75
|
+
- lib/gitlab_glfm_markdown/3.1/gitlab_glfm_markdown.so
|
|
76
|
+
- lib/gitlab_glfm_markdown/3.2/gitlab_glfm_markdown.so
|
|
77
|
+
- lib/gitlab_glfm_markdown/3.3/gitlab_glfm_markdown.so
|
|
78
|
+
- lib/gitlab_glfm_markdown/3.4/gitlab_glfm_markdown.so
|
|
79
|
+
- lib/gitlab_glfm_markdown/loader.rb
|
|
80
|
+
- lib/gitlab_glfm_markdown/version.rb
|
|
81
81
|
homepage: https://gitlab.com/gitlab-org/ruby/gems/gitlab-glfm-markdown
|
|
82
82
|
licenses:
|
|
83
83
|
- MIT
|