Permalink
Browse files

Implement inline code blocks

  • Loading branch information...
1 parent 8d50d22 commit bb0e1c6f238e859e70fb5e7cd48eb8577524aabf @drbrain drbrain committed Oct 30, 2011
Showing with 9 additions and 1 deletion.
  1. +1 −1 pegdown.kpeg
  2. +8 −0 test/test_pegdown.rb
View
@@ -694,7 +694,7 @@ Code = ( Ticks1 Sp < (
!( Sp Ticks5 ) ( Spacechar | Newline !BlankLine )
)+ > Sp Ticks5
)
- { raise " $$ = mk_str(yytext); $$->key = CODE; " }
+ { "<code>#{text}</code>" }
RawHtml = < (HtmlComment | HtmlBlockScript | HtmlTag) >
{ if html? then text else '' end }
View
@@ -90,6 +90,14 @@ def test_parse_block_quote_separate
assert_equal expected, doc
end
+ def test_parse_code
+ doc = parse "Code: `text`"
+
+ expected = doc(para("Code: <code>text</code>"))
+
+ assert_equal expected, doc
+ end
+
def test_parse_entity_dec
doc = parse "Entity: &#65;"

0 comments on commit bb0e1c6

Please sign in to comment.