Skip to content

Instantly share code, notes, and snippets.

@kwappa
Created January 9, 2012 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwappa/1581475 to your computer and use it in GitHub Desktop.
Save kwappa/1581475 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
file_name = ARGV[0]
if !file_name || !File.exists?(file_name)
puts "file not found."
exit
end
File.open(file_name) { |f|
while line = f.gets
puts line.gsub(/href(.+?)>/, %q{href\1 target="_blank">})
end
}
@kwappa
Copy link
Author

kwappa commented Jan 9, 2012

aタグに「target="_blank"」を付与する。毎回書いてる気がするので貼っておく。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment