Class: MaRuKu::MDElement

Inherits:
Object
  • Object
show all
Defined in:
lib/omf-web/widget/text/maruku/helpers.rb

Instance Method Summary collapse

Instance Method Details

#inspect2Object

outputs abbreviated form (this should be eval()uable to get the document)



199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/omf-web/widget/text/maruku/helpers.rb', line 199

def inspect2
  s =
  case @node_type
  when :paragraph
    "md_par(%s)" % children_inspect
  when :footnote_reference
    "md_foot_ref(%s)" % self.footnote_id.inspect
  when :entity
    "md_entity(%s)" % self.entity_name.inspect
  when :email_address
    "md_email(%s)" % self.email.inspect
  when :inline_code
    "md_code(%s)" % self.raw_code.inspect
  when :raw_html
    "md_html(%s)" % self.raw_html.inspect
  when :emphasis
    "md_em(%s)" % children_inspect
  when :strong
    "md_strong(%s)" % children_inspect
  when :immediate_link
    "md_url(%s)" % self.url.inspect
  when :image
    "md_image(%s, %s)" % [
      children_inspect,
      self.ref_id.inspect]
  when :im_image
    "md_im_image(%s, %s, %s)" % [
      children_inspect,
      self.url.inspect,
      self.title.inspect]
  when :link
      "md_link(%s,%s)" % [
        children_inspect, self.ref_id.inspect]
  when :im_link
      "md_im_link(%s, %s, %s)" % [
        children_inspect,
        self.url.inspect,
        self.title.inspect,
      ]
  when :ref_definition
    "md_ref_def(%s, %s, %s)" % [
        self.ref_id.inspect,
        self.url.inspect,
        self.title.inspect
      ]
  when :ial
    "md_ial(%s)" % self.ial.inspect
  else
    return nil
  end
  if @al and not @al.empty? then
    s = s.chop + ", #{@al.inspect})"
  end
  s
end