Module: Markita::Markdown::Definitions
- Defined in:
- lib/markita/markdown/definitions.rb
Overview
Module to isolate from Markdown
Constant Summary collapse
- RGX =
/^[+] (\S.+)$/
Class Method Summary collapse
Class Method Details
.phrase(line) ⇒ Object
11 12 13 14 |
# File 'lib/markita/markdown/definitions.rb', line 11 def self.phrase(line) mdt = RGX.match(line) mdt[1] if mdt end |
.split(phrase) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/markita/markdown/definitions.rb', line 16 def self.split(phrase) return [phrase.chop, nil] if /:$/.match?(phrase) return [nil, phrase] unless (mdt = /^(.*): +(\S.*)$/.match(phrase)) [mdt[1], mdt[2]] end |