+
+print strings
+
+c = 0
+strings.each do |entry|
+ if entry.fuzzy?
+ # Ignore whitespace changes between prev and src
+ if entry.prev.gsub(/ +/, ' ') == entry.src.gsub(/ +/, ' ')
+ entry.status = ''
+ print "clear fuzzy (space)\n"
+ c = c + 1
+ end
+
+ # Rewrite title strings, which lost '#' at the front
+ if entry.prev.gsub(/^#+ +/, '') == entry.src
+ entry.status = ''
+ entry.dest.gsub!(/^#+ +/, '')
+ print "cleared fuzzy (title)\n"
+ c = c + 1
+ end
+
+ # Rewrite footnotes to use "<placeholder type=\"footnote\" id=\"0\"/>"
+ if entry.src =~ /<placeholder type=\\"footnote\\" id=\\"0\\"\/>/
+ print "found footnote\n"
+ p = entry.prev
+ p.sub!(/([a-z]\.["”]?)(\d+)(\s)/, "\\1<placeholder type=\\\"footnote\\\" id=\\\"0\\\"\/>\\3")
+ p.sub!(/([a-z]\.["”]?)(\d+)$/, "\\1<placeholder type=\\\"footnote\\\" id=\\\"0\\\"\/>")
+ print p, "\n"
+ print entry.src, "\n"
+ if p == entry.src
+ entry.status = ''
+ entry.dest.sub!(/([a-z]\.["”»]?)(\d+)(\s)/, "\\1<placeholder type=\\\"footnote\\\" id=\\\"0\\\"\/>\\3")
+ entry.dest.sub!(/([a-z]\.["”»]?)(\d+)$/, "\\1<placeholder type=\\\"footnote\\\" id=\\\"0\\\"\/>")
+ print "cleared fuzzy (footnote)\n"
+ c = c + 1
+ end
+ end
+ end
+ entry.output
+end
+print "Would clear %d fuzzy\n" % [c]