github-markdown 0.5.5 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/markdown/markdown.c +9 -3
- data/github-markdown.gemspec +1 -1
- data/test/gfm_test.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2259a61a92711bdcd173441f680a8562efcb5cf
|
4
|
+
data.tar.gz: 8864e4e619a0c537b562c09ae6380c2d76fcf2d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f246c6463214dda999648c480d5612a70e425e1d11ef10c3f066eb07a100fa4f5d8fe668ba268b2c43b1df10803c6cb2ef55ca40ad0e1772226de968cebd7365
|
7
|
+
data.tar.gz: c9765a24214c9b6b05f24829582c0730e5765ef82526f2975d3d79ba1c37e960b4b500b5a4ce97bd1b15c40e54f2710f0b3bdab59eb272c1626d718ce536d876
|
data/ext/markdown/markdown.c
CHANGED
@@ -1365,7 +1365,7 @@ prefix_uli(uint8_t *data, size_t size)
|
|
1365
1365
|
|
1366
1366
|
if (i < size && data[i] == ' ') i++;
|
1367
1367
|
if (i < size && data[i] == ' ') i++;
|
1368
|
-
|
1368
|
+
if (i < size && data[i] == ' ') i++;
|
1369
1369
|
|
1370
1370
|
if (i + 1 >= size ||
|
1371
1371
|
(data[i] != '*' && data[i] != '+' && data[i] != '-') ||
|
@@ -1630,8 +1630,8 @@ static size_t
|
|
1630
1630
|
parse_listitem(struct buf *ob, struct sd_markdown *rndr, uint8_t *data, size_t size, int *flags)
|
1631
1631
|
{
|
1632
1632
|
struct buf *work = 0, *inter = 0;
|
1633
|
-
size_t beg = 0, end, pre, sublist = 0, orgpre = 0, i;
|
1634
|
-
int in_empty = 0, has_inside_empty = 0, in_fence = 0;
|
1633
|
+
size_t beg = 0, end, pre, sublist = 0, orgpre = 0, previous_indent = 0, i;
|
1634
|
+
int in_empty = 0, has_inside_empty = 0, in_fence = 0, previous_indent_diff = 0;
|
1635
1635
|
|
1636
1636
|
/* keeping track of the first indentation prefix */
|
1637
1637
|
while (orgpre < 3 && orgpre < size && data[orgpre] == ' ')
|
@@ -1678,7 +1678,13 @@ parse_listitem(struct buf *ob, struct sd_markdown *rndr, uint8_t *data, size_t s
|
|
1678
1678
|
while (i < 4 && beg + i < end && data[beg + i] == ' ')
|
1679
1679
|
i++;
|
1680
1680
|
|
1681
|
+
previous_indent_diff = i - previous_indent;
|
1682
|
+
/* allow indentations between 2 and 4 spaces to count as a new list */
|
1683
|
+
if (previous_indent_diff > 1 && previous_indent_diff < 4)
|
1684
|
+
i = 2;
|
1685
|
+
|
1681
1686
|
pre = i;
|
1687
|
+
previous_indent = pre;
|
1682
1688
|
|
1683
1689
|
if (rndr->ext_flags & MKDEXT_FENCED_CODE) {
|
1684
1690
|
if (is_codefence(data + beg + i, end - beg - i, NULL) != 0)
|
data/github-markdown.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = 'github-markdown'
|
4
|
-
s.version = '0.
|
4
|
+
s.version = '0.6.0'
|
5
5
|
s.summary = 'The Markdown parser for GitHub.com'
|
6
6
|
s.description = 'Self-contained Markdown parser for GitHub, with all our custom extensions'
|
7
7
|
s.date = '2013-10-01'
|
data/test/gfm_test.rb
CHANGED
@@ -16,13 +16,13 @@ def html_equal(html_a, html_b)
|
|
16
16
|
end
|
17
17
|
|
18
18
|
class GFMBasicTest < Test::Unit::TestCase
|
19
|
-
Dir['test/fixtures/*.
|
20
|
-
|
21
|
-
|
22
|
-
define_method "test_#{markup}" do
|
19
|
+
Dir['test/fixtures/*.text', 'test/fixtures/Markdown_Redcarpet/**/*.text'].each do |md_file|
|
20
|
+
dirname = File.dirname(md_file)
|
21
|
+
markup = md_file.split('/').last.gsub(/\.text/, '').gsub(/(\s+)/, "_")
|
22
|
+
define_method "test_#{dirname}_#{markup}" do
|
23
23
|
source = File.read(md_file)
|
24
24
|
|
25
|
-
expected_file = "
|
25
|
+
expected_file = "#{dirname}/#{markup}.html"
|
26
26
|
expected = File.read(expected_file).rstrip
|
27
27
|
actual = GitHub::Markdown.render(source).rstrip
|
28
28
|
|