# All files in the 'lib' directory will be loaded # before nanoc starts compiling. def allExceptCode( f, content ) # Beware the behaviour will change if you add # parenthesis (groups) to the regexp! regexp=/]*>.*?<\/code>|]*>.*?<\/pre>/m tmp="" mem=[] content.scan(regexp).each do |c| mem <<= c end i=0 content.split(regexp).each do |x| tmp <<= send(f,x) if not mem[i].nil? tmp <<= mem[i] i+=1 end end tmp end module Nanoc3::Filters class MathJaxKramdownRepair < Nanoc3::Filter identifiers :math_repair def description(content) content.gsub(/
(.+?)<\/div>/m) do %{$$ #{$1} $$} end.gsub(/