Class: Rundown::Processors::Links
- Inherits:
-
Rundown::Processor
- Object
- Rundown::Processor
- Rundown::Processors::Links
- Defined in:
- lib/rundown/processors/links.rb
Constant Summary collapse
- REGEX =
/^([a-z][a-z0-9\*\-\.]*):\/\/(?:(?:(?:[\w\.\-\+!$&'\(\)*\+,;=]|%[0-9a-f]{2})+:)*(?:[\w\.\-\+%!$&'\(\)*\+,;=]|%[0-9a-f]{2})+@)?(?:(?:[a-z0-9\-\.]|%[0-9a-f]{2})+|(?:\[(?:[0-9a-f]{0,4}:)*(?:[0-9a-f]{0,4})\]))(?::[0-9]+)?(?:[\/|\?](?:[\w#!:\.\?\+=&@!$'~*,;\/\(\)\[\]\-]|%[0-9a-f]{2})*)?$/xi
Constants inherited from Rundown::Processor
Rundown::Processor::PUNCTUATION
Instance Attribute Summary
Attributes inherited from Rundown::Processor
Instance Method Summary collapse
Methods inherited from Rundown::Processor
Constructor Details
This class inherits a constructor from Rundown::Processor
Instance Method Details
#process ⇒ Object
6 7 8 |
# File 'lib/rundown/processors/links.rb', line 6 def process words.select { |word| word.match(REGEX) }.map {|word| strip_punctuation(word) } end |