From abceb51dd587940a4508ee523297a5df9973b12a Mon Sep 17 00:00:00 2001 From: Gunnar Wolf Date: Mon, 10 Dec 2018 23:40:12 +0000 Subject: [PATCH] Fix the fixups to properly build (some strings were evaluated as nil) --- fixup-docbook.rb | 4 +++- fixup.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fixup-docbook.rb b/fixup-docbook.rb index 7924145..5219e45 100755 --- a/fixup-docbook.rb +++ b/fixup-docbook.rb @@ -85,7 +85,9 @@ log 0, 'remove empty notes/web links sections' end log 0, 'remove title from dedication' -xml.css('dedication title')[0].content = "" +if ! xml.css('dedication title').empty? + xml.css('dedication title')[0].content = "" +end log 0, 'move legal notice to bookinfo' xml.css('book bookinfo')[0].last_element_child.after('') diff --git a/fixup.rb b/fixup.rb index f8e3c9f..55fae51 100644 --- a/fixup.rb +++ b/fixup.rb @@ -185,7 +185,7 @@ log 0, 'add heading to colophon page' data.insert(data.index('Made With Creative Commons'), '# Colophon {-}') log 0, 'add dedication as separeate chapter' -data.insert(data.index('“I don’t know a whole lot about nonfiction journalism. . .'), '# Dedication {-}') +data.insert(data.index('"I don\'t know a whole lot about nonfiction journalism. . .'), '# Dedication {-}') # Join erroneously split paragraphs: Write the contents of the line # _preceding_ the unneeded break, the break will be removed. -- 2.50.1