Class: Marker::URL
- Inherits:
-
ParseNode
- Object
- Treetop::Runtime::SyntaxNode
- ParseNode
- Marker::URL
- Defined in:
- lib/marker/links.rb
Instance Method Summary collapse
-
#bare_url ⇒ Object
returns just the URL that was matched.
- #to_html(options = {}) ⇒ Object
- #to_s(options = {}) ⇒ Object
Methods inherited from Treetop::Runtime::SyntaxNode
Instance Method Details
#bare_url ⇒ Object
returns just the URL that was matched
154 155 156 |
# File 'lib/marker/links.rb', line 154 def text_value end |
#to_html(options = {}) ⇒ Object
139 140 141 142 143 144 145 146 |
# File 'lib/marker/links.rb', line 139 def to_html( = {} ) url = if url =~ /[.,!?:]$/ "<a href='#{url[0...-1]}'>#{url[0...-1]}</a>#{url[-1,1]}" else "<a href='#{url}'>#{url}</a>" end end |
#to_s(options = {}) ⇒ Object
148 149 150 151 |
# File 'lib/marker/links.rb', line 148 def to_s( = {} ) # no need to worry about trailing punctuation since it's all text. end |