darkmouun 2.0.2 → 2.1.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0e5ba37ba1ee837c723ff67a384a4104f24aa592c1b33d4fa328faaf089a539
|
4
|
+
data.tar.gz: 72e1fbe968e1a41b657918349ea2692516ece783fabfaf762e1ab7cab10b7264
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e208d87f52f188804fd3b25e28313f5d257e703984dc3f8d4091b09c7010e14721d9d64eae1ec799c37fe97ea990d260b8ad686f33f5f2bd19a3c2a54f5ce861
|
7
|
+
data.tar.gz: 0f58155fc090699282ca2020b48eb1a39d78c2bb6b31b619248d98b141bc2c7f8588b6d74540c9bb899e41a2c0bdf9f07f4244121ba0a6da8a8b0c71107fe17c
|
@@ -16,7 +16,7 @@ module Kramdown
|
|
16
16
|
# no nested links allowed
|
17
17
|
if link_type == :a && (@tree.type == :img || @tree.type == :a ||
|
18
18
|
@stack.any? {|t, _| t && (t.type == :img || t.type == :a) })
|
19
|
-
|
19
|
+
parse_span
|
20
20
|
return
|
21
21
|
end
|
22
22
|
el = Element.new(link_type, nil, nil, location: start_line_number)
|
@@ -36,18 +36,14 @@ module Kramdown
|
|
36
36
|
|
37
37
|
# reference style link or no link url
|
38
38
|
if @src.scan(LINK_INLINE_ID_RE) || !@src.check(/\(/)
|
39
|
-
emit_warning = !@src[1]
|
40
39
|
link_id = normalize_link_id(@src[1] || alt_text)
|
41
40
|
if @link_defs.key?(link_id)
|
42
41
|
link_def = @link_defs[link_id]
|
43
42
|
add_link(el, link_def[0], link_def[1], alt_text,
|
44
43
|
link_def[2] && link_def[2].options[:ial])
|
45
44
|
else
|
46
|
-
if emit_warning
|
47
|
-
warning("No link definition for link ID '#{link_id}' found on line #{start_line_number}")
|
48
|
-
end
|
49
45
|
@src.revert_pos(saved_pos)
|
50
|
-
|
46
|
+
parse_span
|
51
47
|
end
|
52
48
|
return
|
53
49
|
end
|
@@ -6,14 +6,13 @@ module Kramdown
|
|
6
6
|
module Parser
|
7
7
|
class Kramdown
|
8
8
|
|
9
|
-
SPAN_START = /(?:\[\s*?)/
|
10
|
-
|
11
9
|
# Parse the span at the current location.
|
12
10
|
def parse_span
|
13
11
|
start_line_number = @src.current_line_number
|
14
12
|
saved_pos = @src.save_pos
|
15
13
|
|
16
|
-
|
14
|
+
span_start = /(?:\[\s*?)/
|
15
|
+
result = @src.scan(span_start)
|
17
16
|
stop_re = /(?:\s*?\])/
|
18
17
|
|
19
18
|
el = Element.new(:span, nil, nil, :location => start_line_number)
|
@@ -23,11 +22,6 @@ module Kramdown
|
|
23
22
|
|
24
23
|
if found
|
25
24
|
@src.scan(stop_re)
|
26
|
-
if @src.check(/\(/)
|
27
|
-
@src.revert_pos(saved_pos)
|
28
|
-
parse_link
|
29
|
-
return
|
30
|
-
end
|
31
25
|
@tree.children << el
|
32
26
|
else
|
33
27
|
@src.revert_pos(saved_pos)
|
@@ -35,7 +29,6 @@ module Kramdown
|
|
35
29
|
add_text(result)
|
36
30
|
end
|
37
31
|
end
|
38
|
-
define_parser(:span, SPAN_START, '\[')
|
39
32
|
|
40
33
|
end
|
41
34
|
end
|
data/lib/darkmouun/kramdown.rb
CHANGED
@@ -9,15 +9,5 @@ module Kramdown
|
|
9
9
|
class Element
|
10
10
|
CATEGORY[:span] = :span
|
11
11
|
end
|
12
|
-
|
13
|
-
module Parser
|
14
|
-
class Kramdown
|
15
|
-
alias_method :super_initialize, :initialize
|
16
|
-
def initialize(source, options)
|
17
|
-
super_initialize(source, options)
|
18
|
-
@span_parsers[5] = :span
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
12
|
end
|
23
13
|
|
data/lib/darkmouun/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: darkmouun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akinori Ichigo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|