microformats / microformats-ruby

Ruby gem that parse HTML containing microformats/microformats2 and returns Ruby objects, a Ruby hash or a JSON hash
https://rubygems.org/gems/microformats
Creative Commons Zero v1.0 Universal
100 stars 29 forks source link

Implement sophisticated url normalization #21

Open jlsuttles opened 11 years ago

jlsuttles commented 11 years ago

php-mf2 tests are comprehensive https://github.com/indieweb/php-mf2/blob/master/tests/Mf2/URLTest.php

veganstraightedge commented 7 years ago

I think this should be created at a standalone gem that this gem then depends on.

veganstraightedge commented 7 years ago

@aaronpk said he'd take this on and would build it as a stand alone gem.

This gem would then need to depend upon and use it.

aaronpk commented 7 years ago

Hmm this gem might already do it: https://github.com/sporkmonger/addressable Take a look at the "join" method.

veganstraightedge commented 7 years ago

For reference, @aaronpk is talking about this method.

https://github.com/sporkmonger/addressable/blob/8f4fee07243af0b788c625e59a9ca529489336d6/lib/addressable/uri.rb#L306

veganstraightedge commented 7 years ago

At quick glance, seems good.

I'll leave it up to implementors to decide whether to use that or create a new gem (if addressable) ends up to be insufficient.

jgarber623 commented 6 years ago

I've just recently abstracted some similarly duplicative code from my own projects into the Absolutely gem which relies on Addressable under-the-hood.

I'll add some more test cases from @aaronpk's aforelinked php-mf2 test suite for completeness.

jgarber623 commented 6 years ago

…and done! Absolutely v1.1.0 adds tests from the php-mf2 URL test suite.

veganstraightedge commented 6 years ago

@jgarber623 You have the Absolutely repo tagged absolute-ur. Maybe you meant absolute-ur?

https://github.com/topics/absolute-ur

vs

https://github.com/topics/absolute-url

jgarber623 commented 6 years ago

@veganstraightedge Good catch. Thanks!