gitlab-glfm-markdown 0.0.11-aarch64-linux → 0.0.13-aarch64-linux

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: 89f546591b147d55180852634e39a4d9626f2993ccd7715d1a61d4aac0f25d2f
4
- data.tar.gz: 1035e4ea6fd4ac53b26b62b984f1296fa1c9492085666dd27905f4f7872aa2c5
3
+ metadata.gz: 20662647752b0827af43e6063ba34d86e71683edc3b1218ec8ab45e444316358
4
+ data.tar.gz: a00f1b672f7d142f09e07ae2609b653d4160682841ab0dfd63f87002ff76ec3b
5
5
  SHA512:
6
- metadata.gz: 0c9f9cf3594e7847a7af5a46ce90df745a40fd6bb0cb57641c10e93ec69a35d832b9e5d6189a1b29f12f61b3f17628361e9a3ac8dd2e2890fd8b160e02f38ae7
7
- data.tar.gz: 3ecf1cd08b6f23326a2d73fe16d5c468171f2d5e71bb073634082c47845862e1ad52c50c0ae80c116317f38180a4e51eb65287f35c77d719c96c87ca95cffe14
6
+ metadata.gz: abb84c15a71bfb2efbd2cf93e3dcd9b2822d359a6925d66f28f149be8e89a26a0c8bf53409bf6672b8053043144e3586a7c372a0e935fdbf1e53d57fed9d0be0
7
+ data.tar.gz: 0e0e06232c4e1387fb8cfbfeb653aebbb6ce5bacdba3e4f14eb559cb92403cbd93d4a79b076e4033b74898894166941ef26d600b7ea66b12e5c95ae83025acf1
data/Cargo.lock CHANGED
@@ -216,9 +216,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
216
216
 
217
217
  [[package]]
218
218
  name = "comrak"
219
- version = "0.20.0"
219
+ version = "0.21.0"
220
220
  source = "registry+https://github.com/rust-lang/crates.io-index"
221
- checksum = "9f18e72341e6cdc7489cffb76f993812a14a906db54dedb020044ccc211dcaae"
221
+ checksum = "6751998a48e2327773c95f6f8e03c6e77c0156ce539d74c17d2199ff3d05e197"
222
222
  dependencies = [
223
223
  "derive_builder",
224
224
  "entities",
@@ -361,7 +361,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
361
361
 
362
362
  [[package]]
363
363
  name = "glfm_markdown"
364
- version = "0.0.11"
364
+ version = "0.0.13"
365
365
  dependencies = [
366
366
  "clap",
367
367
  "comrak",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "glfm_markdown"
3
- version = "0.0.11"
3
+ version = "0.0.13"
4
4
  edition = "2021"
5
5
  authors = ["digitalmoksha <bwalker@gitlab.com>"]
6
6
  description = "GitLab Flavored Markdown parser and formatter. 100% CommonMark-compatible. Experimental."
@@ -15,7 +15,7 @@ required-features = ["cli"]
15
15
 
16
16
  [dependencies]
17
17
  clap = { version = "4.0", optional = true, features = ["derive", "string"] }
18
- comrak = { version = "0.20.0", default-features = false }
18
+ comrak = { version = "0.21.0", default-features = false }
19
19
  magnus = "0.6.2"
20
20
  rb-sys = { version = "0.9.86", default-features = false, features = ["stable-api-compiled-fallback"] }
21
21
 
@@ -7,6 +7,8 @@ pub struct RenderOptions {
7
7
  pub full_info_string: bool,
8
8
  pub github_pre_lang: bool,
9
9
  pub hardbreaks: bool,
10
+ pub header_ids: Option<String>,
11
+ pub multiline_block_quotes: bool,
10
12
  pub relaxed_autolinks: bool,
11
13
  pub relaxed_tasklist_character: bool,
12
14
  pub sourcepos: bool,
@@ -31,6 +33,8 @@ fn render_comrak(text: String, options: RenderOptions) -> String {
31
33
  comrak_options.extension.autolink = options.autolink;
32
34
  comrak_options.extension.description_lists = options.description_lists;
33
35
  comrak_options.extension.footnotes = options.footnotes;
36
+ comrak_options.extension.header_ids = options.header_ids;
37
+ comrak_options.extension.multiline_block_quotes = options.multiline_block_quotes;
34
38
  comrak_options.extension.strikethrough = options.strikethrough;
35
39
  comrak_options.extension.superscript = options.superscript;
36
40
  comrak_options.extension.table = options.table;
@@ -5,30 +5,36 @@ use glfm::{render, RenderOptions};
5
5
 
6
6
  /// Lookup symbol in provided `RHash`. Returns `false` if the key is not present
7
7
  /// or value cannot be converted to a boolean.
8
- fn get_opt(arg: &str, options: RHash) -> bool {
8
+ fn get_bool_opt(arg: &str, options: RHash) -> bool {
9
9
  options.lookup(Symbol::new(arg)).unwrap_or_default()
10
10
  }
11
11
 
12
+ fn get_string_opt(arg: &str, options: RHash) -> Option<String> {
13
+ options.lookup(Symbol::new(arg)).ok()
14
+ }
15
+
12
16
  pub fn render_to_html_rs(text: String, options: RHash) -> String {
13
17
  let render_options = RenderOptions {
14
- autolink: get_opt("autolink", options),
15
- description_lists: get_opt("description_lists", options),
16
- escape: get_opt("escape", options),
17
- footnotes: get_opt("footnotes", options),
18
- full_info_string: get_opt("full_info_string", options),
19
- github_pre_lang: get_opt("github_pre_lang", options),
20
- hardbreaks: get_opt("hardbreaks", options),
21
- relaxed_autolinks: get_opt("relaxed_autolinks", options),
22
- relaxed_tasklist_character: get_opt("relaxed_tasklist_character", options),
23
- sourcepos: get_opt("sourcepos", options),
24
- smart: get_opt("smart", options),
25
- strikethrough: get_opt("strikethrough", options),
26
- superscript: get_opt("superscript", options),
27
- table: get_opt("table", options),
28
- tagfilter: get_opt("tagfilter", options),
29
- tasklist: get_opt("tasklist", options),
30
- unsafe_: get_opt("unsafe", options),
31
- debug: get_opt("debug", options),
18
+ autolink: get_bool_opt("autolink", options),
19
+ description_lists: get_bool_opt("description_lists", options),
20
+ escape: get_bool_opt("escape", options),
21
+ footnotes: get_bool_opt("footnotes", options),
22
+ full_info_string: get_bool_opt("full_info_string", options),
23
+ header_ids: get_string_opt("header_ids", options),
24
+ github_pre_lang: get_bool_opt("github_pre_lang", options),
25
+ hardbreaks: get_bool_opt("hardbreaks", options),
26
+ multiline_block_quotes: get_bool_opt("multiline_block_quotes", options),
27
+ relaxed_autolinks: get_bool_opt("relaxed_autolinks", options),
28
+ relaxed_tasklist_character: get_bool_opt("relaxed_tasklist_character", options),
29
+ sourcepos: get_bool_opt("sourcepos", options),
30
+ smart: get_bool_opt("smart", options),
31
+ strikethrough: get_bool_opt("strikethrough", options),
32
+ superscript: get_bool_opt("superscript", options),
33
+ table: get_bool_opt("table", options),
34
+ tagfilter: get_bool_opt("tagfilter", options),
35
+ tasklist: get_bool_opt("tasklist", options),
36
+ unsafe_: get_bool_opt("unsafe", options),
37
+ debug: get_bool_opt("debug", options),
32
38
  };
33
39
 
34
40
  render(text, render_options)
Binary file
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.11'
4
+ VERSION = '0.0.13'
5
5
  end
data/lib/glfm_markdown.rb CHANGED
@@ -5,25 +5,26 @@ require_relative 'glfm_markdown/loader'
5
5
 
6
6
  load_rust_extension
7
7
 
8
- GLFM_DEFAULT_OPTIONS = {
9
- autolink: true,
10
- footnotes: true,
11
- full_info_string: true,
12
- github_pre_lang: false,
13
- hardbreaks: false,
14
- relaxed_autolinks: false,
15
- sourcepos: true,
16
- smart: false,
17
- strikethrough: true,
18
- table: true,
19
- tagfilter: false,
20
- tasklist: true,
21
- unsafe: true,
8
+ module GLFMMarkdown
9
+ GLFM_DEFAULT_OPTIONS = {
10
+ autolink: true,
11
+ footnotes: true,
12
+ full_info_string: true,
13
+ github_pre_lang: false,
14
+ hardbreaks: false,
15
+ multiline_block_quotes: true,
16
+ relaxed_autolinks: false,
17
+ sourcepos: true,
18
+ smart: false,
19
+ strikethrough: true,
20
+ table: true,
21
+ tagfilter: false,
22
+ tasklist: true,
23
+ unsafe: true,
22
24
 
23
- debug: false
24
- }.freeze
25
+ debug: false
26
+ }.freeze
25
27
 
26
- module GLFMMarkdown
27
28
  class << self
28
29
  def to_html(markdown, options: {})
29
30
  raise TypeError, 'markdown must be a String' unless markdown.is_a?(String)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-glfm-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.13
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Brett Walker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-19 00:00:00.000000000 Z
11
+ date: 2024-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb_sys