diff --git a/Rules b/Rules index 9b04e484d..c41d45f85 100644 --- a/Rules +++ b/Rules @@ -59,6 +59,7 @@ compile '/html/*' do filter :erb # I'll try not to use ruby anymore inside content filter :kramdown # filter :math_repair # after kramdown + filter :fix_img else raise "Filter is not configured for #{item.identifier} in Rules file." end diff --git a/lib/fix_img.rb b/lib/fix_img.rb new file mode 100644 index 000000000..d553b07c9 --- /dev/null +++ b/lib/fix_img.rb @@ -0,0 +1,8 @@ +class FixImage < Nanoc3::Filter + identifier :fix_img + def run(content, params={}) + content.gsub(%r{

(]*>)

}) do |m| + $1.to_s + end + end +end