Sha256: c4bbacf17ab842332d5a9c07e7a920cfd4857202ec00d6c4f4b76e37d6bf8a20

Contents?: true

Size: 441 Bytes

Versions: 6

Compression:

Stored size: 441 Bytes

Contents

def apply_text_html(config, data)
  begin
    require 'rubygems'
  rescue LoadError
  end
  require 'hpricot'
  
  data.collect {|d|
    doc = Hpricot(d.to_s.toutf8)
    texts = []
    doc.traverse_text {|text|
      texts << text.to_s
    }
    
    data2 = eval_pragger(config, texts)
    
    result_html = d.to_s.toutf8
    
    Hash[*texts.zip(data2).flatten].each {|k,v|
      result_html.sub!(k,v)
    }
    
    result_html
  }
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
yapra-0.2.2 legacy_plugins/Filter/apply_text_html.rb
yapra-0.2.0 legacy_plugins/Filter/apply_text_html.rb
yapra-0.1.3 legacy_plugins/Filter/apply_text_html.rb
yapra-0.1.0 legacy_plugins/Filter/apply_text_html.rb
yapra-0.1.1 legacy_plugins/Filter/apply_text_html.rb
yapra-0.1.2 legacy_plugins/Filter/apply_text_html.rb