Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement line breaks
  • Loading branch information
drbrain committed Oct 30, 2011
1 parent 3c038da commit 71908f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 1 addition & 3 deletions pegdown.kpeg
Expand Up @@ -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 }
Expand Down
9 changes: 9 additions & 0 deletions test/test_pegdown.rb
Expand Up @@ -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.
Expand Down

0 comments on commit 71908f3

Please sign in to comment.