Skip to content

Commit

Permalink
Added support for org-table syntax
Browse files Browse the repository at this point in the history
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
rmm5t committed Feb 3, 2013
1 parent 6f515c2 commit e665a0d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext/redcarpet/markdown.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions test/redcarpet_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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~~"

Expand Down

0 comments on commit e665a0d

Please sign in to comment.