cv/filters/links.rb

12 lines
252 B
Ruby
Raw Normal View History

2010-11-18 18:00:25 +00:00
class Links
def run (content)
content.gsub(/(<a [^>]*href="(.)[^>]*>)(.*?)(<\/a>)/) do
if $2 == '#'
$&
else
2010-11-23 09:32:35 +00:00
$1+$3+%{<sup><sub>*</sub></sup>}+$4
2010-11-18 18:00:25 +00:00
end
end
end
end