Permalink
Browse files

Added support for org-table syntax

This just adds support for using a plus (+) as an intersection character
instead of requiring pipes (|). The emacs org-mode table syntax
automatically manages ascii tables, but uses pluses for line
intersections.
  • Loading branch information...
1 parent 6f515c2 commit e665a0d3b33ee0509916be1544326323893ac510 @rmm5t rmm5t committed Feb 3, 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 e665a0d

Please sign in to comment.