sprockets

https://github.com/rails/sprockets

Ruby

Rack-based asset packaging system

Sprockets::Context#optimize_svg_for_uri_escaping!

Optimizes an SVG for being URI-escaped.

This method only performs these basic but crucial optimizations:
* Replaces " with ', because ' does not need escaping.
* Removes comments, meta, doctype, and newlines.
* Collapses whitespace.

Source | Google | Stack overflow

Edit

git clone [email protected]:rails/sprockets.git

cd sprockets

open lib/sprockets/context.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Sprockets--Context-optimize_svg_for_uri_escaping--for-pr


# Commit to git

git add lib/sprockets/context.rbgit commit -m "better docs for Sprockets::Context#optimize_svg_for_uri_escaping!"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Sprockets--Context-optimize_svg_for_uri_escaping--for-pr

hub pull-request


# Celebrate!