Class: SiSU_HTML::Source::Endnotes

Inherits:
Object
  • Object
show all
Includes:
SiSU_HTML_Format
Defined in:
lib/sisu/html.rb

Instance Method Summary collapse

Constructor Details

#initialize(data, md) ⇒ Endnotes

Returns a new instance of Endnotes.



227
228
229
# File 'lib/sisu/html.rb', line 227

def initialize(data,md)
  @data,@md=data,md
end

Instance Method Details

#scrollObject



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/sisu/html.rb', line 230

def scroll
  @scr_endnotes=[]
  SiSU_HTML_Format::HeadScroll.new(@md)
  @data.each do |dob|
    pg=dob.dup
    unless pg.is ==:code
      if pg.obj =~/(?:#{Mx[:en_a_o]}|#{Mx[:en_b_o]})[\d*+]+ /
        endnote_array=[]
        if pg.obj=~/#{Mx[:en_a_o]}[\d*+].+?#{Mx[:en_a_c]}/m
          endnote_array = pg.obj.scan(/#{Mx[:en_a_o]}[\d*+]+(.+?)#{Mx[:en_a_c]}/m)
        end
        if pg.obj=~/#{Mx[:en_b_o]}[\d*]+\s.+?#{Mx[:en_b_c]}/m
          endnote_array = pg.obj.scan(/#{Mx[:en_b_o]}[\d*]+(.+?)#{Mx[:en_b_c]}/m)
        end
        if pg.obj=~/#{Mx[:en_b_o]}[\d+]+\s.+?#{Mx[:en_b_c]}/m
          endnote_array = pg.obj.scan(/#{Mx[:en_b_o]}[\d+]+(.+?)#{Mx[:en_b_c]}/m)
        end
        endnote_array.flatten.each do |note|
          txt_obj={ txt: note }
          format_scroll=SiSU_HTML_Format::FormatScroll.new(@md,txt_obj)
          @scr_endnotes << format_scroll.endnote_body
        end
      end
    end
  end
  @scr_endnotes
end