RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Multigiri: middleware for intelligent post-processing of HTML/XML documents

No more String#gsub in Rack middlewares! Nokogiri can do this dirty job, so why don’t employ it for doing HTML/XML post-processing in middlewares? Multigiri parse your document just once and add the Nokogiri document to all the middlewares for processing in [status, headers, document].

Comments

Copied from the original post to here (too long for FP):

use Multigiri::HTML do
  use Multigiri::HTML5::Forms
  use Multigiri::EmailObfuscator
  use Multigiri::GoogleAnalytics, :my_tracking_code
end

use Multigiri::XML, content_types: ["application/rss+xml", "..."]

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in