calico 0.1.3 → 0.1.4
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.
- data/lib/calico.rb +3 -2
- metadata +2 -2
data/lib/calico.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
class Calico < String
|
2
2
|
|
3
|
-
def to_html
|
3
|
+
def to_html(&blk)
|
4
|
+
@filter = block_given? ? blk : lambda {|x| x }
|
4
5
|
render(parse)
|
5
6
|
end
|
6
7
|
|
@@ -54,7 +55,7 @@ class Calico < String
|
|
54
55
|
end
|
55
56
|
|
56
57
|
def inline(text)
|
57
|
-
xml_escape(text).gsub(/\\\\$/, '<br />').
|
58
|
+
@filter.call xml_escape(text).gsub(/\\\\$/, '<br />').
|
58
59
|
gsub(/\\([^\\\n]|\\(?!\n))/) { "&Calico#{$&.unpack("U*")[1]};" }.
|
59
60
|
gsub(/&(?!#\d+;|#x[\da-fA-F]+;|\w+;)/, "&").
|
60
61
|
gsub(/(`+)(.+?)\1/m, tag(:code, '\2')).
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: calico
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- "Fran\xC3\xA7ois Vaux"
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-07-26 00:00:00 Z
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description: A lightweight markup language
|