From: Petter Reinholdtsen Date: Wed, 31 Jan 2018 19:43:09 +0000 (+0000) Subject: Improve formatting of quote in preface. X-Git-Tag: es-printed~598^2 X-Git-Url: https://pere.pagekite.me/gitweb/text-madewithcc.git/commitdiff_plain/fafc12fd3102b87ca90d04fba898eb6f7fb27f3b Improve formatting of quote in preface. --- 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")}