gitlab-glfm-markdown 0.0.32-x86_64-linux-gnu → 0.0.34-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 017ee3d1f8f03920d91466445cf89757177a847bc51d15abf593ff23b9574b4f
4
- data.tar.gz: 32e65f7fb0a27cea5873b5d3aa771dd572a793907920b69c0c10b894c15bf9cf
3
+ metadata.gz: a90da84f2ba7535bfbedcdb82eb60c77a99e7b4fdd3f5819a02ed862321136c7
4
+ data.tar.gz: 1f28664edfff4214fda35111a162f6b421518107ccbe8dee7a6f56991d93e1ed
5
5
  SHA512:
6
- metadata.gz: 75423882929ec486ec6fd596644bcbf6a2f95231984997956a03ba2f3328f053d34688c4a7a6e3c337db857ac1bfd5e601db2487d2e476f9a5302a9507945d0d
7
- data.tar.gz: eaa2ad5ae07355ccc66618b4ec12d7a1c12856ec66789bfed0589117eea358dadafb13c3cab326deef73e3dbfba70f95c2e83d5456e83a59f191f06a5482c709
6
+ metadata.gz: b4ad5f6eb4a4f66c3b926064715ba29aa1dddeaab14b18ac01a718127fc8a5e9300579625d7d8c30f0e201c110ebf3754161b5da8c0494b37c6b8968073e2fc7
7
+ data.tar.gz: 90222c2d7e6426196620d02af8206c04a612cf9b5fb7b0273c7b4d2c763e7240658df7d182705764af985b8f69b329920d210eae83d56c6a4012ee493532616a
data/Cargo.lock CHANGED
@@ -227,9 +227,9 @@ checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75"
227
227
 
228
228
  [[package]]
229
229
  name = "comrak"
230
- version = "0.39.1"
230
+ version = "0.41.1"
231
231
  source = "registry+https://github.com/rust-lang/crates.io-index"
232
- checksum = "2fefab951771fc3beeed0773ce66a4f7b706273fc6c4c95b08dd1615744abcf5"
232
+ checksum = "9a45df55bc7f91b899160098a7c9b35d6e575dfb4fe22100f014b41a171af2c6"
233
233
  dependencies = [
234
234
  "caseless",
235
235
  "emojis",
@@ -320,7 +320,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
320
320
 
321
321
  [[package]]
322
322
  name = "glfm_markdown"
323
- version = "0.0.32"
323
+ version = "0.0.34"
324
324
  dependencies = [
325
325
  "clap",
326
326
  "comrak",
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Implements GLFM (as used by GitLab) using the Rust-based markdown parser [comrak](https://github.com/kivikakk/comrak)
7
7
  and providing a Ruby interface.\
8
- _Currently using `comrak 0.39.1`_.
8
+ _Currently using `comrak 0.41.1`_.
9
9
 
10
10
  This project is still in constant flux, so interfaces and functionality can change at any time.
11
11
 
@@ -32,43 +32,45 @@ GLFMMarkdown.to_html('# header', options: { sourcepos: true })
32
32
 
33
33
  ### Options
34
34
 
35
- | Option name | Description |
36
- |--------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
37
- | `autolink` | Enable the `autolink` extension |
38
- | `description_lists` | Enable the `description-lists` extension |
39
- | `escape` | Escape raw HTML instead of clobbering it |
40
- | `escape_char_spans` | Wrap escaped characters in a `<span>` to allow any post-processing to recognize them |
41
- | `figure_with_caption` | Render the image as a figure element with the title as its caption |
42
- | `footnotes` | Enable the `footnotes` extension |
43
- | `full_info_string` | Enable full info strings for code blocks |
44
- | `gemojis` | Enable the `gemojis` extensions - translate gemojis into UTF-8 characters |
45
- | `gfm_quirks` | Enables GFM-style quirks in output HTML, such as not nesting <strong> tags |
46
- | `github_pre_lang` | Use GitHub-style `<pre lang>` for code blocks |
47
- | `greentext` | Enable the `greentext` extension - requires at least one space after a `>` character to generate a blockquote, and restarts blockquote nesting across unique lines of input |
48
- | `hardbreaks` | Treat newlines as hard line breaks |
49
- | `header_ids <PREFIX>` | Enable the `header-id` extension, with the given ID prefix |
50
- | `ignore_empty_links` | Ignore empty links in input |
51
- | `ignore_setext` | Ignore setext headings in input |
52
- | `math_code` | Enables `math code` extension, using math code syntax |
53
- | `math_dollars` | Enables `math dollars` extension, using math dollar syntax |
54
- | `multiline_block_quotes` | Enable the `multiline-block-quotes` extension |
55
- | `default_html` | Disables any custom HTML, and returns default HTML from `comrak` |
56
- | `placeholder_detection` | Detect placeholder variables in the format `%{placeholder}` |
57
- | `relaxed_autolinks` | Enable relaxing of autolink parsing, allowing links to be recognized when in brackets |
58
- | `relaxed_tasklist_character` | Enable relaxing which character is allowed in tasklists |
59
- | `sourcepos` | Include source mappings in HTML attributes |
60
- | `smart` | Use smart punctuation |
61
- | `spoiler` | Enable the `spoiler` extension - use double vertical bars |
62
- | `strikethrough` | Enable the `strikethrough` extension |
63
- | `superscript` | Enable the `superscript` extension |
64
- | `table` | Enable the `table` extension |
65
- | `tagfilter` | Enable the `tagfilter` extension |
66
- | `tasklist` | Enable the `tasklist` extension |
67
- | `underline` | Enables the `underline` extension - use double underscores |
68
- | `unsafe` | Allow raw HTML and dangerous URLs |
69
- | `wikilinks_title_after_pipe` | Enable the `wikilinks_title_after_pipe` extension |
70
- | `wikilinks_title_before_pipe` | Enable the `wikilinks_title_before_pipe` extension |
71
- | `debug` | Show debug information |
35
+ | Option name | Description |
36
+ |-------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
37
+ | `autolink` | Enable the `autolink` extension |
38
+ | `description_lists` | Enable the `description-lists` extension |
39
+ | `escape` | Escape raw HTML instead of clobbering it |
40
+ | `escape_char_spans` | Wrap escaped characters in a `<span>` to allow any post-processing to recognize them |
41
+ | `figure_with_caption` | Render the image as a figure element with the title as its caption |
42
+ | `footnotes` | Enable the `footnotes` extension |
43
+ | `full_info_string` | Enable full info strings for code blocks |
44
+ | `gemojis` | Enable the `gemojis` extensions - translate gemojis into UTF-8 characters |
45
+ | `gfm_quirks` | Enables GFM-style quirks in output HTML, such as not nesting <strong> tags |
46
+ | `github_pre_lang` | Use GitHub-style `<pre lang>` for code blocks |
47
+ | `greentext` | Enable the `greentext` extension - requires at least one space after a `>` character to generate a blockquote, and restarts blockquote nesting across unique lines of input |
48
+ | `hardbreaks` | Treat newlines as hard line breaks |
49
+ | `header_ids <PREFIX>` | Enable the `header-id` extension, with the given ID prefix |
50
+ | `ignore_empty_links` | Ignore empty links in input |
51
+ | `ignore_setext` | Ignore setext headings in input |
52
+ | `inapplicable_tasks` | Allow inapplicable tasks items. Must also set the `relaxed_tasklist_character` option. |
53
+ | `math_code` | Enables `math code` extension, using math code syntax |
54
+ | `math_dollars` | Enables `math dollars` extension, using math dollar syntax |
55
+ | `multiline_block_quotes` | Enable the `multiline-block-quotes` extension |
56
+ | `default_html` | Disables any custom HTML, and returns default HTML from `comrak` |
57
+ | `placeholder_detection` | Detect placeholder variables in the format `%{placeholder}` |
58
+ | `relaxed_autolinks` | Enable relaxing of autolink parsing, allowing links to be recognized when in brackets |
59
+ | `relaxed_tasklist_character` | Enable relaxing which character is allowed in tasklists |
60
+ | `sourcepos` | Include source mappings in HTML attributes |
61
+ | `smart` | Use smart punctuation |
62
+ | `spoiler` | Enable the `spoiler` extension - use double vertical bars |
63
+ | `strikethrough` | Enable the `strikethrough` extension |
64
+ | `superscript` | Enable the `superscript` extension |
65
+ | `table` | Enable the `table` extension |
66
+ | `tagfilter` | Enable the `tagfilter` extension |
67
+ | `tasklist` | Enable the `tasklist` extension |
68
+ | `tasklist_classes` | Output classes on tasklist elements so that they can be styled with CSS |
69
+ | `underline` | Enables the `underline` extension - use double underscores |
70
+ | `unsafe` | Allow raw HTML and dangerous URLs |
71
+ | `wikilinks_title_after_pipe` | Enable the `wikilinks_title_after_pipe` extension |
72
+ | `wikilinks_title_before_pipe` | Enable the `wikilinks_title_before_pipe` extension |
73
+ | `debug` | Show debug information |
72
74
 
73
75
  ## Dingus / Demo
74
76
 
@@ -93,7 +95,7 @@ of Ruby for the project and the gem. Otherwise you can see unexplained errors wh
93
95
  calling into the gem.
94
96
 
95
97
  NOTE: This project generates a changelog automatically that gets attached to the release entry.
96
- The normal [GitLab changelog entry process](https://docs.gitlab.com/ee/development/changelog.html)
98
+ The normal [GitLab changelog entry process](https://docs.gitlab.com/development/changelog.html)
97
99
  should be followed.
98
100
 
99
101
  ### Releasing a new version
@@ -227,9 +227,9 @@ checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75"
227
227
 
228
228
  [[package]]
229
229
  name = "comrak"
230
- version = "0.39.1"
230
+ version = "0.41.1"
231
231
  source = "registry+https://github.com/rust-lang/crates.io-index"
232
- checksum = "2fefab951771fc3beeed0773ce66a4f7b706273fc6c4c95b08dd1615744abcf5"
232
+ checksum = "9a45df55bc7f91b899160098a7c9b35d6e575dfb4fe22100f014b41a171af2c6"
233
233
  dependencies = [
234
234
  "caseless",
235
235
  "emojis",
@@ -320,7 +320,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
320
320
 
321
321
  [[package]]
322
322
  name = "glfm_markdown"
323
- version = "0.0.32"
323
+ version = "0.0.34"
324
324
  dependencies = [
325
325
  "clap",
326
326
  "comrak",
@@ -1,8 +1,8 @@
1
1
  [package]
2
2
  name = "glfm_markdown"
3
- version = "0.0.32"
3
+ version = "0.0.34"
4
4
  edition = "2021"
5
- authors = ["digitalmoksha <bwalker@gitlab.com>"]
5
+ authors = ["digitalmoksha <bwalker@gitlab.com>", "Asherah Connor <aconnor@gitlab.com>"]
6
6
  description = "GitLab Flavored Markdown parser and formatter. 100% CommonMark-compatible. Experimental."
7
7
  publish = false
8
8
 
@@ -15,7 +15,7 @@ required-features = ["cli"]
15
15
 
16
16
  [dependencies]
17
17
  clap = { version = "=4.4.18", optional = true, features = ["derive", "string"] }
18
- comrak = { version = "0.39.1", default-features = false, features = ["shortcodes"] }
18
+ comrak = { version = "0.41.1", default-features = false, features = ["shortcodes"] }
19
19
  magnus = "0.6.2"
20
20
  rb-sys = { version = "0.9.86", default-features = false, features = ["stable-api-compiled-fallback"] }
21
21
  regex = "1.11.1"
@@ -1,16 +1,16 @@
1
- use comrak::html::{ChildRendering, Context};
2
- use comrak::nodes::{AstNode, NodeValue};
1
+ use std::io::{self, Write};
2
+
3
+ use comrak::html::{collect_text, format_node_default, render_sourcepos, ChildRendering, Context};
4
+ use comrak::nodes::{AstNode, ListType, NodeValue};
3
5
  use comrak::{create_formatter, html, parse_document, Arena, Plugins};
4
6
  use lazy_static::lazy_static;
5
7
  use regex::Regex;
6
- use std::io;
7
- use std::io::{BufWriter, Write};
8
8
 
9
9
  lazy_static! {
10
10
  static ref PLACEHOLDER_REGEX: Regex = Regex::new(r"%(\{|%7B)(\w{1,30})(}|%7D)").unwrap();
11
11
  }
12
12
 
13
- #[derive(Debug, Clone)]
13
+ #[derive(Debug)]
14
14
  pub struct RenderOptions {
15
15
  pub alerts: bool,
16
16
  pub autolink: bool,
@@ -45,14 +45,20 @@ pub struct RenderOptions {
45
45
  pub table: bool,
46
46
  pub tagfilter: bool,
47
47
  pub tasklist: bool,
48
+ pub tasklist_classes: bool,
48
49
  pub underline: bool,
49
50
  pub unsafe_: bool,
50
51
  pub wikilinks_title_after_pipe: bool,
51
52
  pub wikilinks_title_before_pipe: bool,
52
53
 
54
+ /// GLFM specific options
55
+
53
56
  /// Only use default comrak HTML formatting
54
57
  pub default_html: bool,
55
58
 
59
+ /// Detect inapplicable tasks (`- [~]`)
60
+ pub inapplicable_tasks: bool,
61
+
56
62
  /// Detect and mark potential placeholder variables, which
57
63
  /// have the format `%{PLACEHOLDER}`
58
64
  pub placeholder_detection: bool,
@@ -62,6 +68,7 @@ pub struct RenderOptions {
62
68
 
63
69
  pub struct RenderUserData {
64
70
  pub default_html: bool,
71
+ pub inapplicable_tasks: bool,
65
72
  pub placeholder_detection: bool,
66
73
  pub debug: bool,
67
74
  }
@@ -70,6 +77,7 @@ impl From<&RenderOptions> for RenderUserData {
70
77
  fn from(options: &RenderOptions) -> Self {
71
78
  RenderUserData {
72
79
  default_html: options.default_html,
80
+ inapplicable_tasks: options.inapplicable_tasks,
73
81
  placeholder_detection: options.placeholder_detection,
74
82
  debug: options.debug,
75
83
  }
@@ -112,6 +120,7 @@ impl From<&RenderOptions> for comrak::Options<'_> {
112
120
  comrak_options.render.ignore_empty_links = options.ignore_empty_links;
113
121
  comrak_options.render.ignore_setext = options.ignore_setext;
114
122
  comrak_options.render.sourcepos = options.sourcepos;
123
+ comrak_options.render.tasklist_classes = options.tasklist_classes;
115
124
  // comrak_options.render.syntax_highlighting = options.syntax_highlighting;
116
125
 
117
126
  comrak_options.render.unsafe_ = options.unsafe_;
@@ -139,11 +148,11 @@ fn render_with_plugins(text: String, render_options: RenderOptions, plugins: &Pl
139
148
 
140
149
  let arena = Arena::new();
141
150
  let root = parse_document(&arena, &text, &options);
142
- let mut bw = BufWriter::new(Vec::new());
143
151
 
152
+ let mut bw = Vec::new();
144
153
  CustomFormatter::format_document_with_plugins(root, &options, &mut bw, plugins, user_data)
145
154
  .unwrap();
146
- String::from_utf8(bw.into_inner().unwrap()).unwrap()
155
+ String::from_utf8(bw).unwrap()
147
156
  }
148
157
 
149
158
  // The important thing to remember is that this overrides the default behavior of the
@@ -162,7 +171,16 @@ create_formatter!(CustomFormatter<RenderUserData>, {
162
171
  },
163
172
  NodeValue::Image(_) => |context, node, entering| {
164
173
  return render_image(context, node, entering);
165
- }
174
+ },
175
+ NodeValue::List(_) => |context, node, entering| {
176
+ return render_list(context, node, entering);
177
+ },
178
+ NodeValue::TaskItem(_) => |context, node, entering| {
179
+ return render_task_item(context, node, entering);
180
+ },
181
+ NodeValue::Heading(_) => |context, node, entering| {
182
+ return render_heading(context, node, entering);
183
+ },
166
184
  });
167
185
 
168
186
  fn render_image<'a>(
@@ -171,7 +189,7 @@ fn render_image<'a>(
171
189
  entering: bool,
172
190
  ) -> io::Result<ChildRendering> {
173
191
  let NodeValue::Image(ref nl) = node.data.borrow().value else {
174
- panic!("Attempt to render invalid node as image")
192
+ unreachable!()
175
193
  };
176
194
 
177
195
  if !(context.user.placeholder_detection && PLACEHOLDER_REGEX.is_match(nl.url.as_str())) {
@@ -228,7 +246,7 @@ fn render_link<'a>(
228
246
  entering: bool,
229
247
  ) -> io::Result<ChildRendering> {
230
248
  let NodeValue::Link(ref nl) = node.data.borrow().value else {
231
- panic!("Attempt to render invalid node as link")
249
+ unreachable!()
232
250
  };
233
251
 
234
252
  if !(context.user.placeholder_detection && PLACEHOLDER_REGEX.is_match(nl.url.as_str())) {
@@ -276,13 +294,116 @@ fn render_link<'a>(
276
294
  Ok(ChildRendering::HTML)
277
295
  }
278
296
 
297
+ // Overridden to use class `task-list` instead of `contains-task-list`
298
+ // to align with GitLab class usage
299
+ fn render_list<'a>(
300
+ context: &mut Context<RenderUserData>,
301
+ node: &'a AstNode<'a>,
302
+ entering: bool,
303
+ ) -> io::Result<ChildRendering> {
304
+ if !entering || !context.options.render.tasklist_classes {
305
+ return html::format_node_default(context, node, entering);
306
+ }
307
+
308
+ let NodeValue::List(ref nl) = node.data.borrow().value else {
309
+ unreachable!()
310
+ };
311
+
312
+ context.cr()?;
313
+ match nl.list_type {
314
+ ListType::Bullet => {
315
+ context.write_all(b"<ul")?;
316
+ if nl.is_task_list {
317
+ context.write_all(b" class=\"task-list\"")?;
318
+ }
319
+ html::render_sourcepos(context, node)?;
320
+ context.write_all(b">\n")?;
321
+ }
322
+ ListType::Ordered => {
323
+ context.write_all(b"<ol")?;
324
+ if nl.is_task_list {
325
+ context.write_all(b" class=\"task-list\"")?;
326
+ }
327
+ html::render_sourcepos(context, node)?;
328
+ if nl.start == 1 {
329
+ context.write_all(b">\n")?;
330
+ } else {
331
+ writeln!(context, " start=\"{}\">", nl.start)?;
332
+ }
333
+ }
334
+ }
335
+
336
+ Ok(ChildRendering::HTML)
337
+ }
338
+
339
+ // Overridden to detect inapplicable task list items
340
+ fn render_task_item<'a>(
341
+ context: &mut Context<RenderUserData>,
342
+ node: &'a AstNode<'a>,
343
+ entering: bool,
344
+ ) -> io::Result<ChildRendering> {
345
+ if !context.user.inapplicable_tasks {
346
+ return html::format_node_default(context, node, entering);
347
+ }
348
+
349
+ let NodeValue::TaskItem(symbol) = node.data.borrow().value else {
350
+ unreachable!()
351
+ };
352
+
353
+ if symbol.is_none() || matches!(symbol, Some('x' | 'X')) {
354
+ return html::format_node_default(context, node, entering);
355
+ }
356
+
357
+ if entering {
358
+ // Handle an inapplicable task symbol.
359
+ if matches!(symbol, Some('~')) {
360
+ context.cr()?;
361
+ context.write_all(b"<li")?;
362
+ context.write_all(b" class=\"inapplicable")?;
363
+
364
+ if context.options.render.tasklist_classes {
365
+ context.write_all(b" task-list-item")?;
366
+ }
367
+ context.write_all(b"\"")?;
368
+
369
+ html::render_sourcepos(context, node)?;
370
+ context.write_all(b">")?;
371
+ context.write_all(b"<input type=\"checkbox\"")?;
372
+
373
+ if context.options.render.tasklist_classes {
374
+ context.write_all(b" class=\"task-list-item-checkbox\"")?;
375
+ }
376
+
377
+ context.write_all(b" data-inapplicable disabled=\"\"> ")?;
378
+ } else {
379
+ // Don't allow unsupported symbols to render a checkbox
380
+ context.cr()?;
381
+ context.write_all(b"<li")?;
382
+
383
+ if context.options.render.tasklist_classes {
384
+ context.write_all(b" class=\"task-list-item\"")?;
385
+ }
386
+
387
+ html::render_sourcepos(context, node)?;
388
+ context.write_all(b">")?;
389
+ context.write_all(b"[")?;
390
+ context.escape(symbol.unwrap().to_string().as_bytes())?;
391
+ context.write_all(b"] ")?;
392
+ }
393
+ } else {
394
+ context.write_all(b"</li>\n")?;
395
+ }
396
+
397
+ Ok(ChildRendering::HTML)
398
+ }
399
+
279
400
  fn render_text<'a>(
280
401
  context: &mut Context<RenderUserData>,
281
402
  node: &'a AstNode<'a>,
282
403
  entering: bool,
283
404
  ) -> io::Result<ChildRendering> {
284
405
  let NodeValue::Text(ref literal) = node.data.borrow().value else {
285
- panic!("Attempt to render invalid node as text")
406
+ unreachable!()
286
407
  };
287
408
 
288
409
  if !(context.user.placeholder_detection && PLACEHOLDER_REGEX.is_match(literal)) {
@@ -324,3 +445,45 @@ fn render_text<'a>(
324
445
 
325
446
  Ok(ChildRendering::HTML)
326
447
  }
448
+
449
+ fn render_heading<'a>(
450
+ context: &mut Context<RenderUserData>,
451
+ node: &'a AstNode<'a>,
452
+ entering: bool,
453
+ ) -> io::Result<ChildRendering> {
454
+ let NodeValue::Heading(ref nh) = node.data.borrow().value else {
455
+ unreachable!()
456
+ };
457
+
458
+ match context.plugins.render.heading_adapter {
459
+ None => {
460
+ // Overrides the default handling in order to render the heading text
461
+ // inside the anchor tag to better support screen readers
462
+ if entering {
463
+ context.cr()?;
464
+ write!(context, "<h{}", nh.level)?;
465
+ render_sourcepos(context, node)?;
466
+ context.write_all(b">")?;
467
+
468
+ if let Some(ref prefix) = context.options.extension.header_ids {
469
+ let mut text_content = Vec::with_capacity(20);
470
+ collect_text(node, &mut text_content);
471
+
472
+ let mut id = String::from_utf8(text_content).unwrap();
473
+ id = context.anchorizer.anchorize(id);
474
+ write!(
475
+ context,
476
+ r##"<a href="#{id}" class="anchor" id="{prefix}{id}">"##
477
+ )?;
478
+ }
479
+ } else {
480
+ if context.options.extension.header_ids.is_some() {
481
+ write!(context, "</a>")?;
482
+ }
483
+ writeln!(context, "</h{}>", nh.level)?;
484
+ }
485
+ Ok(ChildRendering::HTML)
486
+ }
487
+ Some(_adapter) => format_node_default(context, node, entering),
488
+ }
489
+ }
@@ -33,6 +33,7 @@ pub fn render_to_html_rs(text: String, options: RHash) -> String {
33
33
  header_ids: get_string_opt("header_ids", options),
34
34
  ignore_empty_links: get_bool_opt("ignore_empty_links", options),
35
35
  ignore_setext: get_bool_opt("ignore_setext", options),
36
+ inapplicable_tasks: get_bool_opt("inapplicable_tasks", options),
36
37
  math_code: get_bool_opt("math_code", options),
37
38
  math_dollars: get_bool_opt("math_dollars", options),
38
39
  multiline_block_quotes: get_bool_opt("multiline_block_quotes", options),
@@ -48,6 +49,7 @@ pub fn render_to_html_rs(text: String, options: RHash) -> String {
48
49
  table: get_bool_opt("table", options),
49
50
  tagfilter: get_bool_opt("tagfilter", options),
50
51
  tasklist: get_bool_opt("tasklist", options),
52
+ tasklist_classes: get_bool_opt("tasklist_classes", options),
51
53
  underline: get_bool_opt("underline", options),
52
54
  unsafe_: get_bool_opt("unsafe", options),
53
55
  wikilinks_title_after_pipe: get_bool_opt("wikilinks_title_after_pipe", options),
@@ -146,6 +146,10 @@ struct Args {
146
146
  #[arg(long)]
147
147
  tasklist: bool,
148
148
 
149
+ /// Output classes on tasklist elements so that they can be styled with CSS
150
+ #[arg(long)]
151
+ tasklist_clases: bool,
152
+
149
153
  /// Enables underlines using double underscores
150
154
  #[arg(long)]
151
155
  underline: bool,
@@ -166,6 +170,12 @@ struct Args {
166
170
  #[arg(long)]
167
171
  default_html: bool,
168
172
 
173
+ /// GLFM specific options
174
+
175
+ /// Detect inapplicable tasks (`- [~]`)
176
+ #[arg(long)]
177
+ inapplicable_tasks: bool,
178
+
169
179
  /// Detect and marks potential placeholder variables, which
170
180
  /// have the format `%{PLACEHOLDER}`
171
181
  #[arg(long)]
@@ -209,6 +219,7 @@ fn main() {
209
219
  header_ids: cli.header_ids,
210
220
  ignore_empty_links: cli.ignore_empty_links,
211
221
  ignore_setext: cli.ignore_setext,
222
+ inapplicable_tasks: cli.inapplicable_tasks,
212
223
  math_code: cli.math_code,
213
224
  math_dollars: cli.math_dollars,
214
225
  multiline_block_quotes: cli.multiline_block_quotes,
@@ -224,6 +235,7 @@ fn main() {
224
235
  table: cli.table,
225
236
  tagfilter: cli.tagfilter,
226
237
  tasklist: cli.tasklist,
238
+ tasklist_classes: cli.tasklist_classes,
227
239
  underline: cli.underline,
228
240
  unsafe_: cli.unsafe_,
229
241
  wikilinks_title_after_pipe: cli.wikilinks_title_after_pipe,
Binary file
Binary file
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GLFMMarkdown
4
- VERSION = '0.0.32'
4
+ VERSION = '0.0.34'
5
5
  end
data/lib/glfm_markdown.rb CHANGED
@@ -14,6 +14,7 @@ module GLFMMarkdown
14
14
  gfm_quirks: true,
15
15
  github_pre_lang: false,
16
16
  hardbreaks: false,
17
+ inapplicable_tasks: false,
17
18
  math_code: false,
18
19
  math_dollars: false,
19
20
  multiline_block_quotes: true,
@@ -24,6 +25,7 @@ module GLFMMarkdown
24
25
  table: true,
25
26
  tagfilter: false,
26
27
  tasklist: true,
28
+ tasklist_classes: true,
27
29
  unsafe: true,
28
30
 
29
31
  debug: false
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-glfm-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.32
4
+ version: 0.0.34
5
5
  platform: x86_64-linux-gnu
6
6
  authors:
7
7
  - Brett Walker
8
+ - Asherah Connor
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2025-07-03 00:00:00.000000000 Z
12
+ date: 2025-09-24 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rb_sys
@@ -55,6 +56,7 @@ dependencies:
55
56
  description: Markdown processing for GitLab Flavored Markdown
56
57
  email:
57
58
  - bwalker@gitlab.com
59
+ - aconnor@gitlab.com
58
60
  executables: []
59
61
  extensions: []
60
62
  extra_rdoc_files: []