literate_md 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/literate_md +4 -2
- metadata +3 -3
data/bin/literate_md
CHANGED
@@ -72,10 +72,12 @@ class Tangle < Redcarpet::Render::Base
|
|
72
72
|
code.scan(/(@(#{$allowed})@\s*\+=)/).map{|x|
|
73
73
|
{:start => code.index(x[0]), :anchor => x[1], :anchor_len => x[0].length}
|
74
74
|
} +
|
75
|
-
[{:start => code.length}]
|
75
|
+
[{:start => code.length, :anchor_len => 0}]
|
76
76
|
(1..chunks.length-1).each{|index|
|
77
77
|
last, this = chunks[index-1], chunks[index]
|
78
|
-
new_snippet = code[
|
78
|
+
new_snippet = code[
|
79
|
+
last[:start] + last[:anchor_len],
|
80
|
+
[this[:start] - this[:anchor_len], 0 ].max ]
|
79
81
|
@links[normalise(last[:anchor],lang)] << new_snippet if not new_snippet.strip.empty?
|
80
82
|
}
|
81
83
|
nil
|
metadata
CHANGED