Permalink
Browse files

Merge pull request #194 from rmm5t/org-table-syntax

Add support for org-table syntax
  • Loading branch information...
2 parents e2087d1 + e665a0d commit 0daea9584da6a8fcec25b05662e5fde33b7a2e5f @robin850 robin850 committed Mar 26, 2013
Showing with 13 additions and 1 deletion.
  1. +1 −1 ext/redcarpet/markdown.c
  2. +12 −0 test/redcarpet_test.rb
View
@@ -2102,7 +2102,7 @@ parse_table_header(
while (i < under_end && data[i] == ' ')
i++;
- if (i < under_end && data[i] != '|')
+ if (i < under_end && data[i] != '|' && data[i] != '+')
break;
if (dashes < 3)
View
@@ -294,6 +294,18 @@ def test_that_tables_flag_works
assert render_with({:tables => true}, text) =~ /<table/
end
+ def test_that_tables_work_with_org_table_syntax
+ text = <<EOS
+| aaa | bbbb |
+|-----+------|
+|hello|sailor|
+EOS
+
+ assert render_with({}, text) !~ /<table/
+
+ assert render_with({:tables => true}, text) =~ /<table/
+ end
+
def test_strikethrough_flag_works
text = "this is ~some~ striked ~~text~~"

0 comments on commit 0daea95

Please sign in to comment.