#!/usr/bin/ruby # #HACK Warning # add around the ...... in certain situations # 1. ...... # 2. ..... # # Read from stdin, write to stdout # Can't depend on the close tag to be on the same line for comment_content # Shouldn't assume that for comment_author but I do $stdin.each do |ln| ln.gsub!(/(.*)<\/wp:comment_author>/, '') if ln[/wp:comment_content>(.*)<\//] # all on one line #ln = "" else ln.gsub!(/^(.*)<\/wp:comment_content>$/) do |m| $1+"]]>" end ln.gsub!(/(.*)$/) do |n| "