Permalink
Browse files

Parse horizontal rule

  • Loading branch information...
drbrain committed Oct 2, 2011
1 parent cd7ee09 commit fae312cf05b49f0863275a5367fac9e22cfd742b
Showing with 32 additions and 1 deletion.
  1. +1 −1 pegdown.kpeg
  2. +31 −0 test/test_pegdown.rb
View
@@ -91,7 +91,7 @@ HorizontalRule = NonindentSpace
| "-" Sp "-" Sp "-" (Sp "-")*
| "_" Sp "_" Sp "_" (Sp "_")*)
Sp Newline BlankLine+
- { raise " $$ = mk_element(HRULE); " }
+ { RDoc::Markup::Rule.new 1 }
Bullet = !HorizontalRule NonindentSpace ("+" | "*" | "-") Spacechar+
View
@@ -113,6 +113,37 @@ def test_parse_plain
assert_equal expected, doc
end
+ def test_parse_rule_dash
+ doc = parse "- - -\n\n"
+
+ expected = @RM::Document.new(@RM::Rule.new(1))
+
+ assert_equal expected, doc
+ end
+
+ def test_parse_rule_underscore
+ doc = parse "_ _ _\n\n"
+
+ expected = @RM::Document.new(@RM::Rule.new(1))
+
+ assert_equal expected, doc
+ end
+
+ def test_parse_rule_star
+ doc = parse "* * *\n\n"
+
+ expected = @RM::Document.new(@RM::Rule.new(1))
+
+ assert_equal expected, doc
+ end
+ def test_parse_rule_star
+ doc = parse "* * *\n\n"
+
+ expected = @RM::Document.new(@RM::Rule.new(1))
+
+ assert_equal expected, doc
+ end
+
# def test_parse_style
# doc = parse <<-MD
#<style></style>

0 comments on commit fae312c

Please sign in to comment.