Sha256: d0523619625d630efd04bf5225fd5cf955ee676314cc7836dcdf42a33e999afe

Contents?: true

Size: 301 Bytes

Versions: 1

Compression:

Stored size: 301 Bytes

Contents

class Slacken::DocumentComponent
  module ExtractImgAlt
    def extract_img_alt
      if type.member_of?(:img)
        child = self.class.new(:text, [], content: attrs[:alt] || attrs[:src])
        derive([child])
      else
        derive(children.map(&:extract_img_alt))
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slacken-0.1.0 lib/slacken/document_component/extract_img_alt.rb