markdown-expander 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/markdown-expander.rb +12 -7
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08884e0ba6130f82bde17019674c76462d0c02fc
|
4
|
+
data.tar.gz: 5fe09c64e9f0962720abf743145a5f557fcb5e5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f3f14364a5409cc72d537ae03226a93f9fb3d5331fb2ad00c3a57e9e0512332d8259f4c2f323a75bb5e36023bc275bc30dc5584a5f28bcdfa9cd2699d530a64
|
7
|
+
data.tar.gz: 835a848e9853d38de2d80aa3d085dc4feee46b334fe35652b8c85bac537d3c8442cef73d46e81859ee2d4411c342a6ee3a83ded495cc2067c3797849c555ac95
|
data/lib/markdown-expander.rb
CHANGED
@@ -21,14 +21,19 @@ module MarkdownExpander
|
|
21
21
|
node = new_node
|
22
22
|
elsif line =~ LOOP_END_MATCH
|
23
23
|
node = node.parent
|
24
|
-
elsif line =~ EXPRESSION_MATCH
|
25
|
-
before_match = $`
|
26
|
-
after_match = $'
|
27
|
-
node.children << Node.new(node, before_match)
|
28
|
-
node.children << Node.new(node, Expression.new($1))
|
29
|
-
node.children << Node.new(node, after_match)
|
30
24
|
else
|
31
|
-
|
25
|
+
loop do
|
26
|
+
if line =~ EXPRESSION_MATCH
|
27
|
+
before_match = $`
|
28
|
+
after_match = $'
|
29
|
+
node.children << Node.new(node, before_match)
|
30
|
+
node.children << Node.new(node, Expression.new($1))
|
31
|
+
line = after_match
|
32
|
+
else
|
33
|
+
node.children << Node.new(node, line)
|
34
|
+
break
|
35
|
+
end
|
36
|
+
end
|
32
37
|
end
|
33
38
|
end
|
34
39
|
|
data/lib/version.rb
CHANGED