c = 0
strings.each do |entry|
- if entry.fuzzy?
- # Ignore whitespace changes between prev and src
- entry.prevclean = entry.prevstr().gsub(/ +/, ' ')
- entry.srcclean = entry.srcstr().gsub(/ +/, ' ')
+ # Ignore whitespace changes between prev and src
+ entry.prevclean = entry.prevstr().gsub(/ +/, ' ')
+ entry.srcclean = entry.srcstr().gsub(/ +/, ' ')
+ if entry.fuzzy?
if entry.prevclean == entry.srcclean
entry.status = ''
- #print "clear fuzzy (space)\n"
+ #print "# clear fuzzy (space)\n"
c = c + 1
next
end
end
end
end
+
+ # Copy image references and single URLs unchanged, even for non-fuzzies
+ if entry.prevclean =~ /!\[\]\(Pictures\// ||
+ entry.srcclean =~ /^<ulink url=\\\".+\\\"\/>$/
+ entry.dest = entry.src.clone()
+ entry.status = ''
+ c = c + 1
+ end
+
entry.output
end
-print "# Would clear %d fuzzy\n" % [c]
+print "# Cleared %d fuzzy strings\n" % [c]