== About
Linkize discovers and parses URLs within normal text. It does this in a way
similar to Adium, with both fully-qualified and more intelligent link parsing.
== Basic Usage
Creating links:
require 'linkize'
"You should see example.com.".recognize_links
=> 'You should see <a href="http://example.com">example.com</a>.'
With custom formatting and in-place replacement:
"You should see example.com.".recognize_links! do |normalized, raw|
"#raw (#normalized)"
end
=> 'You should see example.com (http://example.com).'
Just finding links:
text = "A cool website: example.com"
text.links
# => [#<URI::Generic:0x32dd4 uri:example.com>]
== Documentation
Documentation is supplied using RDoc. Check out the doc/ directory.
== Issues
Please let me know via the RubyForge tracker or email about any bugs you
find. Even better by letting me know with a spec test. Even better than that
is letting me know with a spec test and a patch. Thanks!
== Requirements
You'll need the RSpec gem to run the spec tests.
== TODO
* Use +memoize+ to cache found URIs, to keep from regexing more than once
* Optionally crawl links using +hpricot+ and return relevant images and
descriptive text.
== Author
Phillip Calvin <[email protected]>
http://phillip.toasterlogic.com
== License
This library is licensed under the Ruby License, for maximum compatibility
with other Ruby software. See the LICENSE file for details.
Linkize discovers and parses URLs within normal text. It does this in a way
similar to Adium, with both fully-qualified and more intelligent link parsing.
== Basic Usage
Creating links:
require 'linkize'
"You should see example.com.".recognize_links
=> 'You should see <a href="http://example.com">example.com</a>.'
With custom formatting and in-place replacement:
"You should see example.com.".recognize_links! do |normalized, raw|
"#raw (#normalized)"
end
=> 'You should see example.com (http://example.com).'
Just finding links:
text = "A cool website: example.com"
text.links
# => [#<URI::Generic:0x32dd4 uri:example.com>]
== Documentation
Documentation is supplied using RDoc. Check out the doc/ directory.
== Issues
Please let me know via the RubyForge tracker or email about any bugs you
find. Even better by letting me know with a spec test. Even better than that
is letting me know with a spec test and a patch. Thanks!
== Requirements
You'll need the RSpec gem to run the spec tests.
== TODO
* Use +memoize+ to cache found URIs, to keep from regexing more than once
* Optionally crawl links using +hpricot+ and return relevant images and
descriptive text.
== Author
Phillip Calvin <[email protected]>
http://phillip.toasterlogic.com
== License
This library is licensed under the Ruby License, for maximum compatibility
with other Ruby software. See the LICENSE file for details.