summaryrefslogtreecommitdiff
path: root/test/rdoc/test_rdoc_markdown.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rdoc/test_rdoc_markdown.rb')
-rw-r--r--test/rdoc/test_rdoc_markdown.rb41
1 files changed, 40 insertions, 1 deletions
diff --git a/test/rdoc/test_rdoc_markdown.rb b/test/rdoc/test_rdoc_markdown.rb
index c223c44c12..31d5b068f9 100644
--- a/test/rdoc/test_rdoc_markdown.rb
+++ b/test/rdoc/test_rdoc_markdown.rb
@@ -305,6 +305,25 @@ that also extends to two lines
assert_equal expected, doc
end
+ def test_parse_definition_list_rich_label
+ doc = parse <<-MD
+`one`
+: This is a definition
+
+**two**
+: This is another definition
+ MD
+
+ expected = doc(
+ list(:NOTE,
+ item(%w[<code>one</code>],
+ para("This is a definition")),
+ item(%w[*two*],
+ para("This is another definition"))))
+
+ assert_equal expected, doc
+ end
+
def test_parse_definition_list_no
@parser.definition_lists = false
@@ -761,7 +780,6 @@ with inline notes^[like this]
and an extra note.[^2]
[^1]: With a footnote
-
[^2]: Which should be numbered correctly
MD
@@ -1063,6 +1081,27 @@ and an extra note.[^2]
assert_equal expected, doc
end
+ def test_gfm_table_2
+ doc = parse <<~'MD'
+ | Cmd | Returns | Meaning
+ ----- | :-----: | -------
+ |"b" | boolean | True if file1 is a block device
+ "c" | boolean | True if file1 is a character device
+ |"\|" | boolean | escaped bar \| test
+ MD
+
+ head = %w[Cmd Returns Meaning]
+ align = [nil, :center, nil]
+ body = [
+ ['"b"', 'boolean', 'True if file1 is a block device'],
+ ['"c"', 'boolean', 'True if file1 is a character device'],
+ ['"|"', 'boolean', 'escaped bar | test'],
+ ]
+ expected = doc(@RM::Table.new(head, align, body))
+
+ assert_equal expected, doc
+ end
+
def parse text
@parser.parse text
end