markly 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/markly/markly.so +0 -0
- data/lib/markly/renderer/html_renderer.rb +19 -2
- data/lib/markly/version.rb +1 -1
- metadata +2 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 955e2db3a2000c5172b062923678f0eaaca4b509a6141289dc3173681942b299
|
4
|
+
data.tar.gz: 69b8c19e5e15d4c8596ccebd40a8cbbb491cefc7a1b8a1649711e635b9ec7af3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1401692edab6e63a114894fabbca6b95a5af6c2a50583bfcd858a85ac16622d1442324f3df2dc412e084b11869001afd3b5feedb2ba75a2e5c9c9762540ef76
|
7
|
+
data.tar.gz: e484546eae62ca19662b5853c5d1fe2356843a52e82568c00391e0f5aed954345d4eacea6478d3481757b83e95d3c31c541880f47cb001f95a468cbc6751f3b2
|
data/lib/markly/markly.so
CHANGED
Binary file
|
@@ -1,15 +1,29 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Markly
|
4
|
-
class
|
4
|
+
class HTMLRenderer < Renderer
|
5
|
+
def initialize(ids: false, **options)
|
6
|
+
super(**options)
|
7
|
+
|
8
|
+
@ids = ids
|
9
|
+
end
|
10
|
+
|
5
11
|
def document(_)
|
6
12
|
super
|
7
13
|
out("</ol>\n</section>\n") if @written_footnote_ix
|
8
14
|
end
|
9
15
|
|
16
|
+
def id_for(node)
|
17
|
+
if @ids
|
18
|
+
id = node.to_plaintext.chomp.downcase.gsub(/\s+/, '-')
|
19
|
+
|
20
|
+
return " id=\"#{id}\""
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
10
24
|
def header(node)
|
11
25
|
block do
|
12
|
-
out('<h', node.header_level, "#{source_position(node)}>", :children,
|
26
|
+
out('<h', node.header_level, "#{id_for(node)}#{source_position(node)}>", :children,
|
13
27
|
'</h', node.header_level, '>')
|
14
28
|
end
|
15
29
|
end
|
@@ -249,4 +263,7 @@ module Markly
|
|
249
263
|
node.tasklist_item_checked?
|
250
264
|
end
|
251
265
|
end
|
266
|
+
|
267
|
+
# Legacy.
|
268
|
+
HtmlRenderer = HTMLRenderer
|
252
269
|
end
|
data/lib/markly/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: markly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-06-
|
13
|
+
date: 2020-06-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bake
|
@@ -26,34 +26,6 @@ dependencies:
|
|
26
26
|
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '0'
|
29
|
-
- !ruby/object:Gem::Dependency
|
30
|
-
name: bake-bundler
|
31
|
-
requirement: !ruby/object:Gem::Requirement
|
32
|
-
requirements:
|
33
|
-
- - ">="
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version: '0'
|
36
|
-
type: :development
|
37
|
-
prerelease: false
|
38
|
-
version_requirements: !ruby/object:Gem::Requirement
|
39
|
-
requirements:
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: '0'
|
43
|
-
- !ruby/object:Gem::Dependency
|
44
|
-
name: bake-modernize
|
45
|
-
requirement: !ruby/object:Gem::Requirement
|
46
|
-
requirements:
|
47
|
-
- - ">="
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '0'
|
50
|
-
type: :development
|
51
|
-
prerelease: false
|
52
|
-
version_requirements: !ruby/object:Gem::Requirement
|
53
|
-
requirements:
|
54
|
-
- - ">="
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: '0'
|
57
29
|
- !ruby/object:Gem::Dependency
|
58
30
|
name: minitest
|
59
31
|
requirement: !ruby/object:Gem::Requirement
|