From 785c7f6bf9f6f2630ea9f75e2f68a18bb71294c4 Mon Sep 17 00:00:00 2001 From: Masayoshi Takahashi Date: Wed, 13 Apr 2016 09:49:37 +0900 Subject: [PATCH] update epubversion and htmlversion (#542) --- lib/epubmaker/producer.rb | 4 +- lib/review/configure.rb | 4 +- test/test_epubmaker.rb | 99 +++++++++++++++++---------------------- test/test_htmlbuilder.rb | 16 +++---- 4 files changed, 56 insertions(+), 67 deletions(-) diff --git a/lib/epubmaker/producer.rb b/lib/epubmaker/producer.rb index ab6bab9f0..49bb9a0ac 100644 --- a/lib/epubmaker/producer.rb +++ b/lib/epubmaker/producer.rb @@ -219,8 +219,8 @@ def complement "isbn" => nil, "toclevel" => 2, "stylesheet" => [], - "epubversion" => 2, - "htmlversion" => 4, + "epubversion" => 3, + "htmlversion" => 5, "secnolevel" => 2, "pre_secnolevel" => 0, "post_secnolevel" => 1, diff --git a/lib/review/configure.rb b/lib/review/configure.rb index 8252af7e0..3aebaf7e5 100644 --- a/lib/review/configure.rb +++ b/lib/review/configure.rb @@ -30,7 +30,7 @@ def self.values "params" => "", # specify review2html parameters "toclevel" => 3, # level of toc "secnolevel" => 2, # level of section # - "epubversion" => 2, + "epubversion" => 3, "titlepage" => true, # Use title page "toc" => nil, # Use table of contents in body "colophon" => nil, # Use colophon @@ -39,7 +39,7 @@ def self.values "language" => 'ja', # XXX default language should be JA?? "mathml" => nil, # for HTML "htmlext" => "html", - "htmlversion" => 4, + "htmlversion" => 5, "chapter_file" => 'CHAPS', "part_file" => 'PART', diff --git a/test/test_epubmaker.rb b/test/test_epubmaker.rb index 457db7669..705757e4d 100644 --- a/test/test_epubmaker.rb +++ b/test/test_epubmaker.rb @@ -451,12 +451,11 @@ def test_stage3_mytoc @producer.mytoc(@output) expect = < - - + + - - - + + Table of Contents @@ -483,12 +482,11 @@ def test_stage3_flat @producer.mytoc(@output) expect = < - - + + - - - + + Table of Contents @@ -513,12 +511,11 @@ def test_stage3_cover @producer.cover(@output) expect = < - - + + - - - + + Sample Book @@ -535,12 +532,11 @@ def test_stage3_cover_escape @producer.cover(@output) expect = < - - + + - - - + + Sample<>Book @@ -557,12 +553,11 @@ def test_stage3_cover_with_image @producer.cover(@output) expect = < - - + + - - - + + Sample Book @@ -582,12 +577,11 @@ def test_stage3_cover_with_image_escape @producer.cover(@output) expect = < - - + + - - - + + Sample<>Book @@ -607,12 +601,11 @@ def test_colophon_default @producer.colophon(@output) expect = < - - + + - - - + + Colophon @@ -643,12 +636,11 @@ def test_colophon_default_escape_and_multiple @producer.colophon(@output) expect = < - - + + - - - + + Colophon @@ -677,12 +669,11 @@ def test_colophon_pht @producer.colophon(@output) expect = < - - + + - - - + + Colophon @@ -731,12 +722,11 @@ def test_title @producer.titlepage(@output) expect = < - - + + - - - + + Sample Book @@ -765,12 +755,11 @@ def test_title_single_value_param @producer.titlepage(@output) expect = < - - + + - - - + + Sample Book diff --git a/test/test_htmlbuilder.rb b/test/test_htmlbuilder.rb index 40f73f646..c82239661 100644 --- a/test/test_htmlbuilder.rb +++ b/test/test_htmlbuilder.rb @@ -25,11 +25,11 @@ def setup end def test_xmlns_ops_prefix_epub3 - @book.config["epubversion"] = 3 assert_equal "epub", @builder.xmlns_ops_prefix end def test_xmlns_ops_prefix_epub2 + @book.config["epubversion"] = 2 assert_equal "ops", @builder.xmlns_ops_prefix end @@ -218,17 +218,17 @@ def test_inline_b_and_escape def test_inline_tt actual = compile_inline("test @{inline test} test2") - assert_equal %Q|test inline test test2|, actual + assert_equal %Q|test inline test test2|, actual end def test_inline_tti actual = compile_inline("test @{inline test} test2") - assert_equal %Q|test inline test test2|, actual + assert_equal %Q|test inline test test2|, actual end def test_inline_ttb actual = compile_inline("test @{inline test} test2") - assert_equal %Q|test inline test test2|, actual + assert_equal %Q|test inline test test2|, actual end def test_inline_hd_chap @@ -285,12 +285,12 @@ def test_inline_uchar def test_inline_ruby actual = compile_inline("@{粗雑,クルード}と思われているなら@{繊細,テクニカル}にやり、繊細と思われているなら粗雑にやる。") - assert_equal "粗雑クルードと思われているなら繊細テクニカルにやり、繊細と思われているなら粗雑にやる。", actual + assert_equal "粗雑クルードと思われているなら繊細テクニカルにやり、繊細と思われているなら粗雑にやる。", actual end def test_inline_ruby_comma actual = compile_inline("@{foo\\, bar\\, buz,フー・バー・バズ}") - assert_equal "foo, bar, buzフー・バー・バズ", actual + assert_equal "foo, bar, buzフー・バー・バズ", actual end def test_inline_ref @@ -1045,7 +1045,7 @@ def test_inline_fn @chapter.instance_eval{@footnote_index=fn} actual = compile_block("//footnote[foo][bar\\a\\$buz]\n") expected =<<-'EOS' -

[*1] bar\a\$buz

+

[*1] bar\a\$buz

EOS assert_equal expected, actual end @@ -1055,7 +1055,7 @@ def test_inline_fn_with_tricky_id @chapter.instance_eval{@footnote_index=fn} actual = compile_block("//footnote[123 あ_;][bar\\a\\$buz]\n") expected =<<-'EOS' -

[*1] bar\a\$buz

+

[*1] bar\a\$buz

EOS assert_equal expected, actual end