Skip to content
Browse files

Implement line breaks

  • Loading branch information...
1 parent 3c038da commit 71908f326d549c2f780071011318b3da89a997a8 @drbrain drbrain committed Oct 30, 2011
Showing with 10 additions and 3 deletions.
  1. +1 −3 pegdown.kpeg
  2. +9 −0 test/test_pegdown.rb
View
4 pegdown.kpeg
@@ -545,10 +545,8 @@ NormalEndline = Sp Newline !BlankLine !">" !AtxStart
{ "\n" }
TerminalEndline = Sp Newline Eof
- { }
-LineBreak = " " NormalEndline
- { raise " $$ = mk_element(LINEBREAK); " }
+LineBreak = < " " NormalEndline > { text }
Symbol = < SpecialChar >
{ text }
View
9 test/test_pegdown.rb
@@ -159,6 +159,15 @@ def test_parse_html_address_no_html
assert_equal expected, doc
end
+ def test_parse_line_braek
+ doc = parse "Some text \nwith extra lines"
+
+ expected = doc(
+ para("Some text \nwith extra lines"))
+
+ assert_equal expected, doc
+ end
+
def test_parse_link_reference_id
doc = parse <<-MD
This is [an example][id] reference-style link.

0 comments on commit 71908f3

Please sign in to comment.
Something went wrong with that request. Please try again.