markly 0.15.2 → 0.15.3
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
- checksums.yaml.gz.sig +0 -0
- data/ext/markly/blocks.c +15 -1
- data/lib/markly/renderer/html.rb +2 -3
- data/lib/markly/version.rb +1 -1
- data/license.md +2 -2
- data/readme.md +17 -1
- data.tar.gz.sig +0 -0
- metadata +5 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 76b9702e08b93aa97c2fe8b02d0ac1faea07b8037cf093c48d87b4b7e260806a
|
|
4
|
+
data.tar.gz: b3cad63b1de5e67e2160c72731f28cea94d02fbe999c5b2f2201f3e94b6c84b7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 701981fe8e9c6a229cc93042a40b4600e9d627903dd5f50e80089e2766c506ceb780c9feb3cb0ca3cdb1621be0e58db5cff0795925c8b42324d4b763312abaf0
|
|
7
|
+
data.tar.gz: 5500f4778efd6753dd6ffc9a5717c372c4a0d422db38695466bb2ddd9bb16a3a1ba138c34382f9ed3278c4a69ff75a29172ce581ce0138a20e4ab3b6c9b2be8a
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/ext/markly/blocks.c
CHANGED
|
@@ -77,11 +77,25 @@ static CMARK_INLINE bool S_is_space_or_tab(char c) {
|
|
|
77
77
|
// - Document node (special case)
|
|
78
78
|
// - Fenced code blocks (end on the closing fence line)
|
|
79
79
|
// - Setext headings (end on the underline)
|
|
80
|
-
// -
|
|
80
|
+
// - HTML blocks types 1-5 per CommonMark spec §4.6 (end on the line
|
|
81
|
+
// containing the closing marker)
|
|
82
|
+
// - Any block finalized on the same line it started (e.g., single-line blocks)
|
|
81
83
|
static CMARK_INLINE bool S_ends_on_current_line(cmark_parser *parser, cmark_node *b) {
|
|
82
84
|
return S_type(b) == CMARK_NODE_DOCUMENT ||
|
|
83
85
|
(S_type(b) == CMARK_NODE_CODE_BLOCK && b->as.code.fenced) ||
|
|
84
86
|
(S_type(b) == CMARK_NODE_HEADING && b->as.heading.setext) ||
|
|
87
|
+
// HTML block types per CommonMark spec §4.6:
|
|
88
|
+
// 1: <script>, <pre>, <style>, <textarea> (ends at </tag>)
|
|
89
|
+
// 2: <!-- (ends at -->)
|
|
90
|
+
// 3: <? (ends at ?>)
|
|
91
|
+
// 4: <! + letter (ends at >)
|
|
92
|
+
// 5: <![CDATA[ (ends at ]]>)
|
|
93
|
+
// All five end on the line containing their closing marker,
|
|
94
|
+
// similar to fenced code blocks.
|
|
95
|
+
// Types 6-7 end at a blank line, so their last content line is
|
|
96
|
+
// the previous line and they should NOT match here.
|
|
97
|
+
(S_type(b) == CMARK_NODE_HTML_BLOCK && b->as.html_block_type >= 1 &&
|
|
98
|
+
b->as.html_block_type <= 5) ||
|
|
85
99
|
// Single-line blocks: finalized on same line they started
|
|
86
100
|
b->start_line == parser->line_number;
|
|
87
101
|
}
|
data/lib/markly/renderer/html.rb
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# Copyright, 2017, by Yuki Izumi.
|
|
7
7
|
# Copyright, 2017-2019, by Ashe Connor.
|
|
8
8
|
# Copyright, 2018, by Michael Camilleri.
|
|
9
|
-
# Copyright, 2020-
|
|
9
|
+
# Copyright, 2020-2026, by Samuel Williams.
|
|
10
10
|
|
|
11
11
|
require_relative "generic"
|
|
12
12
|
require_relative "headings"
|
|
@@ -69,8 +69,7 @@ module Markly
|
|
|
69
69
|
out("<section#{id_for(node)}>")
|
|
70
70
|
end
|
|
71
71
|
|
|
72
|
-
out("<h", node.header_level, "#{source_position(node)}>", :children,
|
|
73
|
-
"</h", node.header_level, ">")
|
|
72
|
+
out("<h", node.header_level, "#{source_position(node)}>", :children, "</h", node.header_level, ">")
|
|
74
73
|
end
|
|
75
74
|
end
|
|
76
75
|
|
data/lib/markly/version.rb
CHANGED
data/license.md
CHANGED
|
@@ -18,10 +18,10 @@ Copyright, 2018, by Danny Iachini.
|
|
|
18
18
|
Copyright, 2019-2020, by Tomoya Chiba.
|
|
19
19
|
Copyright, 2019, by Brett Walker.
|
|
20
20
|
Copyright, 2020-2025, by Olle Jonsson.
|
|
21
|
-
Copyright, 2020-
|
|
21
|
+
Copyright, 2020-2026, by Samuel Williams.
|
|
22
22
|
Copyright, 2024, by Ross Kaffenberger.
|
|
23
23
|
Copyright, 2025, by Henrik Nyh.
|
|
24
|
-
Copyright, 2025, by Peter H. Boling.
|
|
24
|
+
Copyright, 2025-2026, by Peter H. Boling.
|
|
25
25
|
|
|
26
26
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
27
27
|
of this software and associated documentation files (the "Software"), to deal
|
data/readme.md
CHANGED
|
@@ -6,7 +6,7 @@ A parser and abstract syntax tree for Markdown documents (CommonMark compatible)
|
|
|
6
6
|
|
|
7
7
|
## Motivation
|
|
8
8
|
|
|
9
|
-
This code base was originally forked from [Commonmarker](https://github.com/gjtorikian/commonmarker) before
|
|
9
|
+
This code base was originally forked from [Commonmarker](https://github.com/gjtorikian/commonmarker) before they switched from `cmark-gfm` (C) to `comrak` (Rust). The original implementation provided access to the abstract syntax tree (AST), which is useful for building tools on top of Markdown. The Rust implementation did not provide this functionality, and so this fork was created to continue to provide these (and more) features.
|
|
10
10
|
|
|
11
11
|
It should be noted that `commonmarker` re-introduced AST access, but the original C implementation in this fork is [3-4x faster at processing Markdown into HTML](https://github.com/gjtorikian/commonmarker?tab=readme-ov-file#benchmarks) and has a more advanced HTML generation and AST processing features.
|
|
12
12
|
|
|
@@ -46,6 +46,22 @@ We welcome contributions to this project.
|
|
|
46
46
|
4. Push to the branch (`git push origin my-new-feature`).
|
|
47
47
|
5. Create new Pull Request.
|
|
48
48
|
|
|
49
|
+
### Running Tests
|
|
50
|
+
|
|
51
|
+
To run the test suite:
|
|
52
|
+
|
|
53
|
+
``` shell
|
|
54
|
+
bundle exec sus
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Making Releases
|
|
58
|
+
|
|
59
|
+
To make a new release:
|
|
60
|
+
|
|
61
|
+
``` shell
|
|
62
|
+
bundle exec bake gem:release:patch # or minor or major
|
|
63
|
+
```
|
|
64
|
+
|
|
49
65
|
### Developer Certificate of Origin
|
|
50
66
|
|
|
51
67
|
In order to protect users of this project, we require all contributors to comply with the [Developer Certificate of Origin](https://developercertificate.org/). This ensures that all contributions are properly licensed and attributed.
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: markly
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.15.
|
|
4
|
+
version: 0.15.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Garen Torikian
|
|
8
|
-
- Yuki Izumi
|
|
9
8
|
- Samuel Williams
|
|
9
|
+
- Yuki Izumi
|
|
10
10
|
- John MacFarlane
|
|
11
11
|
- Ashe Connor
|
|
12
12
|
- Nick Wellnhofer
|
|
@@ -15,6 +15,7 @@ authors:
|
|
|
15
15
|
- Ben Woosley
|
|
16
16
|
- Goro Fuji
|
|
17
17
|
- Olle Jonsson
|
|
18
|
+
- Peter H. Boling
|
|
18
19
|
- Tomoya Chiba
|
|
19
20
|
- Akira Matsuda
|
|
20
21
|
- Danny Iachini
|
|
@@ -22,7 +23,6 @@ authors:
|
|
|
22
23
|
- Jerry van Leeuwen
|
|
23
24
|
- Michael Camilleri
|
|
24
25
|
- Mu-An Chiou
|
|
25
|
-
- Peter H. Boling
|
|
26
26
|
- Roberto Hidalgo
|
|
27
27
|
- Ross Kaffenberger
|
|
28
28
|
- Vitaliy Klachkov
|
|
@@ -164,14 +164,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
164
164
|
requirements:
|
|
165
165
|
- - ">="
|
|
166
166
|
- !ruby/object:Gem::Version
|
|
167
|
-
version: '3.
|
|
167
|
+
version: '3.3'
|
|
168
168
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
169
|
requirements:
|
|
170
170
|
- - ">="
|
|
171
171
|
- !ruby/object:Gem::Version
|
|
172
172
|
version: '0'
|
|
173
173
|
requirements: []
|
|
174
|
-
rubygems_version:
|
|
174
|
+
rubygems_version: 4.0.6
|
|
175
175
|
specification_version: 4
|
|
176
176
|
summary: CommonMark parser and renderer. Written in C, wrapped in Ruby.
|
|
177
177
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|