diff --git a/ext/commonmarker/src/node.rs b/ext/commonmarker/src/node.rs index fb644a8a..ac849f54 100644 --- a/ext/commonmarker/src/node.rs +++ b/ext/commonmarker/src/node.rs @@ -128,19 +128,25 @@ impl CommonmarkerNode { } "description_list" => ComrakNodeValue::DescriptionList, "description_item" => { - let kwargs = scan_args::get_kwargs::<_, (), (Option, Option), ()>( - args.keywords, - &[], - &["marker_offset", "padding"], + let kwargs = scan_args::get_kwargs::< + _, + (), + (Option, Option, Option), + (), + >( + args.keywords, &[], &["marker_offset", "padding", "tight"] )?; - let (marker_offset, padding) = kwargs.optional; + let (marker_offset, padding, tight) = kwargs.optional; ComrakNodeValue::DescriptionItem(NodeDescriptionItem { // Number of spaces before the list marker. marker_offset: marker_offset.unwrap_or(0), // Number of characters between the start of the list marker and the item text (including the list marker(s)). padding: padding.unwrap_or(0), + // Whether the list is [tight](https://github.github.com/gfm/#tight), i.e. whether the + // paragraphs are wrapped in `

` tags when formatted as HTML. + tight: tight.unwrap_or(false), }) } "description_term" => ComrakNodeValue::DescriptionTerm, diff --git a/test/extensions_test.rb b/test/extensions_test.rb index 1eae6bcc..eb370dff 100644 --- a/test/extensions_test.rb +++ b/test/extensions_test.rb @@ -39,20 +39,18 @@ def test_comments_are_kept_as_expected def test_definition_lists markdown = <<~MARKDOWN - ~strikethrough disabled to ensure options accepted~ - Commonmark Definition : Ruby wrapper for comrak (CommonMark parser) MARKDOWN - extensions = { strikethrough: false, description_lists: true } + extensions = { description_lists: true } options = { extension: extensions, render: { hardbreaks: false } } output = Commonmarker.to_html(markdown, options: options) html = <<~HTML -

~strikethrough disabled to ensure options accepted~

-
Commonmark Definition
+
+
Commonmark Definition

Ruby wrapper for comrak (CommonMark parser)