From fafc12fd3102b87ca90d04fba898eb6f7fb27f3b Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Wed, 31 Jan 2018 19:43:09 +0000 Subject: [PATCH] Improve formatting of quote in preface. --- fixup.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/fixup.rb b/fixup.rb index d15b243..543a66a 100644 --- a/fixup.rb +++ b/fixup.rb @@ -215,5 +215,24 @@ log 0, 'Join erroneously split paragraphs' end end +log 0, 'Mark quote in dedication as quote with attribute in markdown' +start = "“I don’t know a whole lot about nonfiction journalism. . ." +stop = "- David Foster Wallace" +quote=false +data.each_with_index do |lin, idx| + if lin == stop + lin.sub!(/^- /, "> — ") + lin.sub!("David Foster Wallace", "David Foster Wallace") + quote=false + break + end + if lin == start + quote=true + end + if quote + lin.sub!(/^/, "> ") + end +end + log 0, 'Writing processed file' File.open(dstfile, 'w') {|f| f.puts data.join("\n")} -- 2.47.2