Skip to content
Browse files

Remove requirement of three dashes for table headers

Originally introduced in:

vmg/sundown@35a580f

This requirement doesn't seem necessary, at least I hope :crossfingers:

Fixes #476.
  • Loading branch information...
1 parent 7747906 commit 4f3a899191633a1da68156c925ff9eaee6d0b8f0 @robin850 robin850 committed Jun 22, 2016
Showing with 15 additions and 1 deletion.
  1. +3 −0 CHANGELOG.md
  2. +1 −1 ext/redcarpet/markdown.c
  3. +11 −0 test/markdown_test.rb
View
3 CHANGELOG.md
@@ -1,5 +1,8 @@
# Changelog
+* Table headers don't require a minimum of three dashes anymore; a
+ single one can be used for each row.
+
* Remove escaped entities from `HTML` render table of contents'
ids to be consistent with the `HTML_TOC` render.
View
2 ext/redcarpet/markdown.c
@@ -2339,7 +2339,7 @@ parse_table_header(
if (i < under_end && data[i] != '|' && data[i] != '+')
break;
- if (dashes < 3)
+ if (dashes < 1)
break;
i++;
View
11 test/markdown_test.rb
@@ -392,4 +392,15 @@ def test_autolink_with_period_next_to_url
assert_equal result, output
end
+
+ def test_single_dashes_on_table_headers
+ markdown = <<-Markdown.strip_heredoc
+ | a | b |
+ | - | - |
+ | c | d |
+ Markdown
+ output = render(markdown, with: [:tables])
+
+ assert_match /<table>/, output
+ end
end

0 comments on commit 4f3a899

Please sign in to comment.
Something went wrong with that request. Please try again.