Skip to content

Commit

Permalink
add initial qanda list test; fix spacing between questions
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Sep 6, 2019
1 parent 9b3d283 commit 853a648
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
This document provides a high-level view of the changes to the {project-name} by release.
For a detailed view of what has changed, refer to the {uri-repo}/commits/master[commit history] on GitHub.

== Unreleased

* Fix spacing between items in qanda list

== 1.5.0.beta.4 (2019-09-04) - @mojavelinux

* always use ; as delimiter to separate multiple font dirs to be compatible with JAR paths (#1250)
Expand Down
2 changes: 1 addition & 1 deletion lib/asciidoctor-pdf/converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ def convert_outline_list_item node, list, opts = {}
def convert_content_for_list_item node, list_type, opts = {}
if list_type == :dlist # qanda
terms, desc = node
[*terms].each {|term| layout_prose %(<em>#{term.text}</em>), opts }
[*terms].each {|term| layout_prose %(<em>#{term.text}</em>), (opts.merge margin_top: 0, margin_bottom: @theme.description_list_term_spacing) }
if desc
layout_prose desc.text, opts if desc.text?
convert_content_for_block desc
Expand Down
15 changes: 15 additions & 0 deletions spec/list_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,21 @@
end
end

context 'Q & A' do
it 'should layout Q & A list like a description list with questions in italic', integration: true do
to_file = to_pdf_file <<~'EOS', 'list-qanda.pdf'
[qanda]
What's the answer to the ultimate question?:: 42
Do you have an opinion?::
Would you like to share it?::
Yes and no.
EOS

(expect to_file).to visually_match 'list-qanda.pdf'
end
end

context 'Callout' do
it 'should use callout numbers as list markers and in referenced block' do
pdf = to_pdf <<~'EOS', analyze: true
Expand Down
Binary file added spec/reference/list-qanda.pdf
Binary file not shown.

0 comments on commit 853a648

Please sign in to comment.