Class: Elisp::DocStringParser::Email
- Inherits:
-
Object
- Object
- Elisp::DocStringParser::Email
- Defined in:
- lib/elisp/doc_string_parser.rb
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(content) ⇒ Email
constructor
A new instance of Email.
- #pandoc_json_object ⇒ Object
Constructor Details
#initialize(content) ⇒ Email
Returns a new instance of Email.
175 176 177 |
# File 'lib/elisp/doc_string_parser.rb', line 175 def initialize(content) @content = content end |
Instance Method Details
#html ⇒ Object
179 180 181 182 183 |
# File 'lib/elisp/doc_string_parser.rb', line 179 def html uri = CGI.escape(@content) address = CGI.escape_html(@content) %(<a href="mailto:#{uri}">#{address}</a>) end |
#pandoc_json_object ⇒ Object
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/elisp/doc_string_parser.rb', line 185 def pandoc_json_object { "t": "Link", "c": [ ["", ["email"], []], [ { "t": "Str", "c": @content, } ], [ "mailto:#{@content}", "", ], ], } end |