Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add "\n" before caption #467

Merged
merged 2 commits into from
Nov 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/review/latexbuilder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ def list(lines, id, caption = nil, lang = nil)
buf << common_code_block_lst(lines, 'reviewlistlst', 'caption', caption, lang)
else
begin
buf << "\n"
buf << macro('reviewlistcaption', "#{I18n.t("list")}#{I18n.t("format_number_header", [@chapter.number, @chapter.list(id).number])}#{I18n.t("caption_prefix")}#{caption}") + "\n"
rescue KeyError
error "no such list: #{id}"
Expand All @@ -277,6 +278,7 @@ def listnum(lines, id, caption = nil, lang = nil)
buf << common_code_block_lst(lines, 'reviewlistnumlst', 'caption', caption, lang)
else
begin
buf << "\n"
buf << macro('reviewlistcaption', "#{I18n.t("list")}#{I18n.t("format_number_header", [@chapter.number, @chapter.list(id).number])}#{I18n.t("caption_prefix")}#{caption}") + "\n"
rescue KeyError
error "no such list: #{id}"
Expand Down
2 changes: 1 addition & 1 deletion test/test_latexbuilder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def test_emlist_with_tab4

def test_listnum
actual = compile_block("//listnum[test1][ruby]{\nclass Foo\n def foo\n bar\n\n buz\n end\nend\n//}\n")
assert_equal %Q|\\reviewlistcaption{リスト1.1: ruby}\n\\reviewlistcaption{ruby}\n\\begin{reviewlist}\n 1: class Foo\n 2: def foo\n 3: bar\n 4: \n 5: buz\n 6: end\n 7: end\n\\end{reviewlist}\n|, actual
assert_equal %Q|\n\\reviewlistcaption{リスト1.1: ruby}\n\\reviewlistcaption{ruby}\n\\begin{reviewlist}\n 1: class Foo\n 2: def foo\n 3: bar\n 4: \n 5: buz\n 6: end\n 7: end\n\\end{reviewlist}\n|, actual
end

def test_listnum_lst
Expand Down