Class: Elisp::DocStringParser::HTMLURL
- Inherits:
-
Object
- Object
- Elisp::DocStringParser::HTMLURL
- Defined in:
- lib/elisp/doc_string_parser.rb
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(content) ⇒ HTMLURL
constructor
A new instance of HTMLURL.
- #pandoc_json_object ⇒ Object
Constructor Details
#initialize(content) ⇒ HTMLURL
Returns a new instance of HTMLURL.
143 144 145 |
# File 'lib/elisp/doc_string_parser.rb', line 143 def initialize(content) @content = content end |
Instance Method Details
#html ⇒ Object
147 148 149 150 151 152 |
# File 'lib/elisp/doc_string_parser.rb', line 147 def html url = @content.to_s ref = CGI.escape(url) label = CGI.escape_html(url) %(<a class="pure-url" href="#{ref}">#{label}</a>) end |
#pandoc_json_object ⇒ Object
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/elisp/doc_string_parser.rb', line 154 def pandoc_json_object { "t": "Link", "c": [ ["", ["uri"], []], [ { "t": "Str", "c": @content, } ], [ @content, "", ], ], } end |