diff --git a/README.adoc b/README.adoc index 50c16b1..c192044 100644 --- a/README.adoc +++ b/README.adoc @@ -39,7 +39,7 @@ Next, grab the Asciidoctor gem (the sources) and put it into the `$HOME/rpmbuild Finally, copy the `.patch` files from this repository to the same directory: - cp patches/* $HOME/rpmbuild/SOURCES/ + cp *.patch $HOME/rpmbuild/SOURCES/ You're now ready to build the RPM. diff --git a/asciidoctor-disable-use-of-pending.patch b/asciidoctor-disable-use-of-pending.patch new file mode 100644 index 0000000..0da086e --- /dev/null +++ b/asciidoctor-disable-use-of-pending.patch @@ -0,0 +1,16 @@ +# disables use of pending statement in the test suite The required gem, +# pending, is not packaged in Fedora and since the statement is merely a task +# note, it's safe to disable it's usage for the purpose of packaging. +diff --git a/test/test_helper.rb b/test/test_helper.rb +index 3b27218..964ff59 100644 +--- a/test/test_helper.rb ++++ b/test/test_helper.rb +@@ -10,7 +10,7 @@ rescue LoadError + end + require 'htmlentities' + require 'nokogiri' +-require 'pending' ++#require 'pending' + + ENV['SUPPRESS_DEBUG'] ||= 'true' + diff --git a/asciidoctor-fix-nth-child-selectors.patch b/asciidoctor-fix-nth-child-selectors.patch new file mode 100644 index 0000000..803be16 --- /dev/null +++ b/asciidoctor-fix-nth-child-selectors.patch @@ -0,0 +1,50 @@ +# Nokogiri is choking on assertions that use nth-child with a loose parent match +diff --git a/test/tables_test.rb b/test/tables_test.rb +index 5ccb92e..d86a70d 100644 +--- a/test/tables_test.rb ++++ b/test/tables_test.rb +@@ -21,8 +21,8 @@ context 'Tables' do + assert_css 'table td', output, 9 + assert_css 'table > tbody > tr > td.tableblock.halign-left.valign-top > p.tableblock', output, 9 + cells.each_with_index {|row, rowi| +- assert_css "table tr:nth-child(#{rowi + 1}) > td", output, row.size +- assert_css "table tr:nth-child(#{rowi + 1}) > td > p", output, row.size ++ assert_css "table > tbody > tr:nth-child(#{rowi + 1}) > td", output, row.size ++ assert_css "table > tbody > tr:nth-child(#{rowi + 1}) > td > p", output, row.size + row.each_with_index {|cell, celli| + assert_xpath "(//tr)[#{rowi + 1}]/td[#{celli + 1}]/p[text()='#{cell}']", output, 1 + } +@@ -272,21 +272,21 @@ d|9 2+>|10 + assert_css 'table > tbody > tr:nth-child(3) > td', output, 1 + assert_css 'table > tbody > tr:nth-child(4) > td', output, 2 + +- assert_css 'table tr:nth-child(1) > td:nth-child(1).halign-left.valign-top p em', output, 1 +- assert_css 'table tr:nth-child(1) > td:nth-child(2).halign-right.valign-top p strong', output, 1 +- assert_css 'table tr:nth-child(1) > td:nth-child(3).halign-center.valign-top p', output, 1 +- assert_css 'table tr:nth-child(1) > td:nth-child(3).halign-center.valign-top p *', output, 0 +- assert_css 'table tr:nth-child(1) > td:nth-child(4).halign-right.valign-top p strong', output, 1 ++ assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(1).halign-left.valign-top p em', output, 1 ++ assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(2).halign-right.valign-top p strong', output, 1 ++ assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(3).halign-center.valign-top p', output, 1 ++ assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(3).halign-center.valign-top p *', output, 0 ++ assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(4).halign-right.valign-top p strong', output, 1 + +- assert_css 'table tr:nth-child(2) > td:nth-child(1).halign-center.valign-top p em', output, 1 +- assert_css 'table tr:nth-child(2) > td:nth-child(2).halign-center.valign-middle[colspan="2"][rowspan="2"] p tt', output, 1 +- assert_css 'table tr:nth-child(2) > td:nth-child(3).halign-left.valign-bottom[rowspan="3"] p tt', output, 1 ++ assert_css 'table > tbody > tr:nth-child(2) > td:nth-child(1).halign-center.valign-top p em', output, 1 ++ assert_css 'table > tbody > tr:nth-child(2) > td:nth-child(2).halign-center.valign-middle[colspan="2"][rowspan="2"] p tt', output, 1 ++ assert_css 'table > tbody > tr:nth-child(2) > td:nth-child(3).halign-left.valign-bottom[rowspan="3"] p tt', output, 1 + +- assert_css 'table tr:nth-child(3) > td:nth-child(1).halign-center.valign-top p em', output, 1 ++ assert_css 'table > tbody > tr:nth-child(3) > td:nth-child(1).halign-center.valign-top p em', output, 1 + +- assert_css 'table tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p', output, 1 +- assert_css 'table tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p em', output, 0 +- assert_css 'table tr:nth-child(4) > td:nth-child(2).halign-right.valign-top[colspan="2"] p tt', output, 1 ++ assert_css 'table > tbody > tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p', output, 1 ++ assert_css 'table > tbody > tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p em', output, 0 ++ assert_css 'table > tbody > tr:nth-child(4) > td:nth-child(2).halign-right.valign-top[colspan="2"] p tt', output, 1 + end + + test 'supports repeating cells' do diff --git a/patches/asciidoctor-disable-use-of-pending.patch b/patches/asciidoctor-disable-use-of-pending.patch deleted file mode 100644 index 0da086e..0000000 --- a/patches/asciidoctor-disable-use-of-pending.patch +++ /dev/null @@ -1,16 +0,0 @@ -# disables use of pending statement in the test suite The required gem, -# pending, is not packaged in Fedora and since the statement is merely a task -# note, it's safe to disable it's usage for the purpose of packaging. -diff --git a/test/test_helper.rb b/test/test_helper.rb -index 3b27218..964ff59 100644 ---- a/test/test_helper.rb -+++ b/test/test_helper.rb -@@ -10,7 +10,7 @@ rescue LoadError - end - require 'htmlentities' - require 'nokogiri' --require 'pending' -+#require 'pending' - - ENV['SUPPRESS_DEBUG'] ||= 'true' - diff --git a/patches/asciidoctor-fix-nth-child-selectors.patch b/patches/asciidoctor-fix-nth-child-selectors.patch deleted file mode 100644 index 803be16..0000000 --- a/patches/asciidoctor-fix-nth-child-selectors.patch +++ /dev/null @@ -1,50 +0,0 @@ -# Nokogiri is choking on assertions that use nth-child with a loose parent match -diff --git a/test/tables_test.rb b/test/tables_test.rb -index 5ccb92e..d86a70d 100644 ---- a/test/tables_test.rb -+++ b/test/tables_test.rb -@@ -21,8 +21,8 @@ context 'Tables' do - assert_css 'table td', output, 9 - assert_css 'table > tbody > tr > td.tableblock.halign-left.valign-top > p.tableblock', output, 9 - cells.each_with_index {|row, rowi| -- assert_css "table tr:nth-child(#{rowi + 1}) > td", output, row.size -- assert_css "table tr:nth-child(#{rowi + 1}) > td > p", output, row.size -+ assert_css "table > tbody > tr:nth-child(#{rowi + 1}) > td", output, row.size -+ assert_css "table > tbody > tr:nth-child(#{rowi + 1}) > td > p", output, row.size - row.each_with_index {|cell, celli| - assert_xpath "(//tr)[#{rowi + 1}]/td[#{celli + 1}]/p[text()='#{cell}']", output, 1 - } -@@ -272,21 +272,21 @@ d|9 2+>|10 - assert_css 'table > tbody > tr:nth-child(3) > td', output, 1 - assert_css 'table > tbody > tr:nth-child(4) > td', output, 2 - -- assert_css 'table tr:nth-child(1) > td:nth-child(1).halign-left.valign-top p em', output, 1 -- assert_css 'table tr:nth-child(1) > td:nth-child(2).halign-right.valign-top p strong', output, 1 -- assert_css 'table tr:nth-child(1) > td:nth-child(3).halign-center.valign-top p', output, 1 -- assert_css 'table tr:nth-child(1) > td:nth-child(3).halign-center.valign-top p *', output, 0 -- assert_css 'table tr:nth-child(1) > td:nth-child(4).halign-right.valign-top p strong', output, 1 -+ assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(1).halign-left.valign-top p em', output, 1 -+ assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(2).halign-right.valign-top p strong', output, 1 -+ assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(3).halign-center.valign-top p', output, 1 -+ assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(3).halign-center.valign-top p *', output, 0 -+ assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(4).halign-right.valign-top p strong', output, 1 - -- assert_css 'table tr:nth-child(2) > td:nth-child(1).halign-center.valign-top p em', output, 1 -- assert_css 'table tr:nth-child(2) > td:nth-child(2).halign-center.valign-middle[colspan="2"][rowspan="2"] p tt', output, 1 -- assert_css 'table tr:nth-child(2) > td:nth-child(3).halign-left.valign-bottom[rowspan="3"] p tt', output, 1 -+ assert_css 'table > tbody > tr:nth-child(2) > td:nth-child(1).halign-center.valign-top p em', output, 1 -+ assert_css 'table > tbody > tr:nth-child(2) > td:nth-child(2).halign-center.valign-middle[colspan="2"][rowspan="2"] p tt', output, 1 -+ assert_css 'table > tbody > tr:nth-child(2) > td:nth-child(3).halign-left.valign-bottom[rowspan="3"] p tt', output, 1 - -- assert_css 'table tr:nth-child(3) > td:nth-child(1).halign-center.valign-top p em', output, 1 -+ assert_css 'table > tbody > tr:nth-child(3) > td:nth-child(1).halign-center.valign-top p em', output, 1 - -- assert_css 'table tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p', output, 1 -- assert_css 'table tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p em', output, 0 -- assert_css 'table tr:nth-child(4) > td:nth-child(2).halign-right.valign-top[colspan="2"] p tt', output, 1 -+ assert_css 'table > tbody > tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p', output, 1 -+ assert_css 'table > tbody > tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p em', output, 0 -+ assert_css 'table > tbody > tr:nth-child(4) > td:nth-child(2).halign-right.valign-top[colspan="2"] p tt', output, 1 - end - - test 'supports repeating cells' do