Class: Rundown::Processors::Links

Inherits:
Rundown::Processor show all
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

#text, #words

Instance Method Summary collapse

Methods inherited from Rundown::Processor

#initialize, #sentences

Constructor Details

This class inherits a constructor from Rundown::Processor

Instance Method Details

#processObject



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