Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Inconsistency between #image_tag and #link_to in escaping URIs #2016
As you can see,
Per rfc3986 space cannot be a part of proper URI.
Fixing this for
Breaking this for
I implemented a proper link escaper for modern internet document links based on https://github.com/ruby-rdf/rdf gem: https://github.com/padrino/padrino-framework/blob/link-escaper/padrino-support/lib/padrino-support/utils/link_escaper.rb
The thing is, there is virtually no difference between this and just doing
The test examples are here: https://github.com/padrino/padrino-framework/blob/link-escaper/padrino-support/test/test_link_escaper.rb
I'm tending to just scrap this escaper and use simple gsub. It covers 99.9% of common IRI syntax violations (space) and does not invade pre-encoded links.