marker 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/marker/language.treetop +6 -6
- data/test/formatting_test.rb +10 -0
- metadata +2 -2
data/lib/marker/language.treetop
CHANGED
@@ -7,9 +7,9 @@
|
|
7
7
|
module Marker
|
8
8
|
grammar Language
|
9
9
|
rule markup
|
10
|
-
h:block rnl r:markup <Markup>
|
10
|
+
h:block ws rnl r:markup <Markup>
|
11
11
|
/
|
12
|
-
h:block
|
12
|
+
h:block ws <Markup>
|
13
13
|
end
|
14
14
|
|
15
15
|
rule block
|
@@ -87,9 +87,9 @@ module Marker
|
|
87
87
|
|
88
88
|
# a series of list items, so they can be coalesced
|
89
89
|
rule list
|
90
|
-
h:list_item rnl r:list <List>
|
90
|
+
h:list_item ws rnl r:list <List>
|
91
91
|
/
|
92
|
-
h:list_item
|
92
|
+
h:list_item ws <List>
|
93
93
|
end
|
94
94
|
|
95
95
|
# for matching any list item
|
@@ -194,7 +194,7 @@ module Marker
|
|
194
194
|
rule text
|
195
195
|
!line h:phrase ws rnl r:text <Paragraph>
|
196
196
|
/
|
197
|
-
!line h:phrase
|
197
|
+
!line h:phrase ws <Paragraph>
|
198
198
|
end
|
199
199
|
|
200
200
|
# a block of text that does not require a !line check
|
@@ -208,7 +208,7 @@ module Marker
|
|
208
208
|
rule unsafe_text
|
209
209
|
h:phrase ws rnl r:text <Paragraph>
|
210
210
|
/
|
211
|
-
h:phrase
|
211
|
+
h:phrase ws <Paragraph>
|
212
212
|
end
|
213
213
|
|
214
214
|
# a phrase of words without newlines
|
data/test/formatting_test.rb
CHANGED
@@ -95,4 +95,14 @@ class FormattingTest < Test::Unit::TestCase
|
|
95
95
|
assert_match("<hr />\n<p>----</p>", markup.to_html)
|
96
96
|
end
|
97
97
|
|
98
|
+
def test_trailing_spaces
|
99
|
+
text = "text "
|
100
|
+
markup = Marker.parse text
|
101
|
+
assert_match("<p>text</p>", markup.to_html)
|
102
|
+
|
103
|
+
text = "a line of text "
|
104
|
+
markup = Marker.parse text
|
105
|
+
assert_match("<p>a line of text</p>", markup.to_html)
|
106
|
+
end
|
107
|
+
|
98
108
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Blue
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-30 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|