Skip to content

Instantly share code, notes, and snippets.

@kwappa
Created Jan 9, 2012
Embed
What would you like to do?
#!/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

This comment has been minimized.

Copy link
Owner Author

@kwappa 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