gitlab-glfm-markdown 0.0.35-x86_64-linux-gnu → 0.0.37-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 +1 -1
- data/README.md +5 -0
- data/ext/glfm_markdown/Cargo.lock +1 -1
- data/ext/glfm_markdown/Cargo.toml +1 -1
- data/ext/glfm_markdown/src/formatter.rs +1 -43
- data/ext/glfm_markdown/src/glfm.rs +2 -0
- data/ext/glfm_markdown/src/main.rs +5 -0
- 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/lib/glfm_markdown/version.rb +1 -1
- data/lib/glfm_markdown.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6da81aabdd360ce78e2a28d1adeb891b9783e3818b2e0b819c8906ca465c0935
|
|
4
|
+
data.tar.gz: b98301ab9b1ec7db67763a26e2c1d671095d527ad04a929add576b259182ad2a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8dca03d3ca6c088964857c9790ee23d54d177d9d667904cccd3ef2e8dc9c27937eb18bc00fb298238dd4365251edcb64d8a1878babf5a9fdcf2904be720bd701
|
|
7
|
+
data.tar.gz: d8382a6219cdc9224494e7377f7dd864eaf411b65632829f36891aa71babfa55485c423b7e6591f4483a7b8f6d856f8fcca63f1d709959989ea1b0d8cfbd3f39
|
data/Cargo.lock
CHANGED
data/README.md
CHANGED
|
@@ -37,6 +37,7 @@ GLFMMarkdown.to_html('# header', options: { sourcepos: true })
|
|
|
37
37
|
| Option name | Description |
|
|
38
38
|
|-------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
39
39
|
| `autolink` | Enable the `autolink` extension |
|
|
40
|
+
| `cjk_friendly_emphasis` | Enable the `cjk_friendly_emphasis` extension |
|
|
40
41
|
| `description_lists` | Enable the `description-lists` extension |
|
|
41
42
|
| `escape` | Escape raw HTML instead of clobbering it |
|
|
42
43
|
| `escape_char_spans` | Wrap escaped characters in a `<span>` to allow any post-processing to recognize them |
|
|
@@ -111,4 +112,8 @@ published to [RubyGems](https://rubygems.org/gems/gitlab-glfm-markdown).
|
|
|
111
112
|
|
|
112
113
|
Bug reports and merge requests are welcome on GitLab at https://gitlab.com/gitlab-org/ruby/gems/gitlab-glfm-markdown.
|
|
113
114
|
|
|
115
|
+
Visit the [Community Contribute](https://about.gitlab.com/community/contribute/)
|
|
116
|
+
page for general information about contributing to GitLab, and using the
|
|
117
|
+
[community fork](https://gitlab.com/gitlab-community/gitlab-org/ruby/gems/gitlab-glfm-markdown).
|
|
118
|
+
|
|
114
119
|
Please refer to [CONTRIBUTING](CONTRIBUTING.md) for more details.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "glfm_markdown"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.37"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
authors = ["digitalmoksha <bwalker@gitlab.com>", "Asherah Connor <aconnor@gitlab.com>"]
|
|
6
6
|
description = "GitLab Flavored Markdown parser and formatter. 100% CommonMark-compatible. Experimental."
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
use std::fmt::{self, Write};
|
|
2
2
|
|
|
3
|
-
use comrak::html::{
|
|
3
|
+
use comrak::html::{render_sourcepos, ChildRendering, Context};
|
|
4
4
|
use comrak::nodes::{AstNode, ListType, NodeValue};
|
|
5
5
|
use comrak::{create_formatter, html};
|
|
6
6
|
use lazy_static::lazy_static;
|
|
@@ -43,9 +43,6 @@ create_formatter!(CustomFormatter<RenderUserData>, {
|
|
|
43
43
|
NodeValue::TaskItem(_) => |context, node, entering| {
|
|
44
44
|
return render_task_item(context, node, entering);
|
|
45
45
|
},
|
|
46
|
-
NodeValue::Heading(_) => |context, node, entering| {
|
|
47
|
-
return render_heading(context, node, entering);
|
|
48
|
-
},
|
|
49
46
|
NodeValue::Escaped => |context, node, entering| {
|
|
50
47
|
return render_escaped(context, node, entering);
|
|
51
48
|
},
|
|
@@ -312,45 +309,6 @@ fn render_text<'a>(
|
|
|
312
309
|
Ok(ChildRendering::HTML)
|
|
313
310
|
}
|
|
314
311
|
|
|
315
|
-
fn render_heading<'a>(
|
|
316
|
-
context: &mut Context<RenderUserData>,
|
|
317
|
-
node: &'a AstNode<'a>,
|
|
318
|
-
entering: bool,
|
|
319
|
-
) -> Result<ChildRendering, fmt::Error> {
|
|
320
|
-
let NodeValue::Heading(ref nh) = node.data.borrow().value else {
|
|
321
|
-
unreachable!()
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
match context.plugins.render.heading_adapter {
|
|
325
|
-
None => {
|
|
326
|
-
// Overrides the default handling in order to render the heading text
|
|
327
|
-
// inside the anchor tag to better support screen readers
|
|
328
|
-
if entering {
|
|
329
|
-
context.cr()?;
|
|
330
|
-
write!(context, "<h{}", nh.level)?;
|
|
331
|
-
render_sourcepos(context, node)?;
|
|
332
|
-
context.write_str(">")?;
|
|
333
|
-
|
|
334
|
-
if let Some(ref prefix) = context.options.extension.header_ids {
|
|
335
|
-
let text_content = collect_text(node);
|
|
336
|
-
let id = context.anchorizer.anchorize(&text_content);
|
|
337
|
-
write!(
|
|
338
|
-
context,
|
|
339
|
-
r##"<a href="#{id}" class="anchor" id="{prefix}{id}">"##
|
|
340
|
-
)?;
|
|
341
|
-
}
|
|
342
|
-
} else {
|
|
343
|
-
if context.options.extension.header_ids.is_some() {
|
|
344
|
-
write!(context, "</a>")?;
|
|
345
|
-
}
|
|
346
|
-
writeln!(context, "</h{}>", nh.level)?;
|
|
347
|
-
}
|
|
348
|
-
Ok(ChildRendering::HTML)
|
|
349
|
-
}
|
|
350
|
-
Some(_adapter) => format_node_default(context, node, entering),
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
312
|
fn render_escaped<'a>(
|
|
355
313
|
context: &mut Context<RenderUserData>,
|
|
356
314
|
node: &'a AstNode<'a>,
|
|
@@ -8,6 +8,7 @@ use crate::formatter::{CustomFormatter, RenderUserData};
|
|
|
8
8
|
pub struct RenderOptions {
|
|
9
9
|
pub alerts: bool,
|
|
10
10
|
pub autolink: bool,
|
|
11
|
+
pub cjk_friendly_emphasis: bool,
|
|
11
12
|
// pub default_info_string: String,
|
|
12
13
|
pub description_lists: bool,
|
|
13
14
|
pub escape: bool,
|
|
@@ -82,6 +83,7 @@ impl From<&RenderOptions> for comrak::Options<'_> {
|
|
|
82
83
|
|
|
83
84
|
comrak_options.extension.alerts = options.alerts;
|
|
84
85
|
comrak_options.extension.autolink = options.autolink;
|
|
86
|
+
comrak_options.extension.cjk_friendly_emphasis = options.cjk_friendly_emphasis;
|
|
85
87
|
comrak_options.extension.description_lists = options.description_lists;
|
|
86
88
|
comrak_options.extension.footnotes = options.footnotes;
|
|
87
89
|
// comrak_options.extension.front_matter_delimiter = options.front_matter_delimiter;
|
|
@@ -188,6 +188,10 @@ struct Args {
|
|
|
188
188
|
#[arg(long)]
|
|
189
189
|
only_escape_chars: Option<String>,
|
|
190
190
|
|
|
191
|
+
/// Enable 'cjk_friendly_emphasis' extension
|
|
192
|
+
#[arg(long)]
|
|
193
|
+
cjk_friendly_emphasis: bool,
|
|
194
|
+
|
|
191
195
|
/// Show debug information
|
|
192
196
|
#[arg(long)]
|
|
193
197
|
debug: bool,
|
|
@@ -210,6 +214,7 @@ fn main() {
|
|
|
210
214
|
let options = RenderOptions {
|
|
211
215
|
alerts: cli.alerts,
|
|
212
216
|
autolink: cli.autolink,
|
|
217
|
+
cjk_friendly_emphasis: cli.cjk_friendly_emphasis,
|
|
213
218
|
// default_info_string:
|
|
214
219
|
description_lists: cli.description_lists,
|
|
215
220
|
escape: cli.escape,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/glfm_markdown.rb
CHANGED
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.37
|
|
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-
|
|
12
|
+
date: 2025-10-14 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rb_sys
|