Sha256: ab3217f3da69d7b4513fc14b372c2c0e2884ed3390e3a81248fbcab94ebcd37a
Contents?: true
Size: 657 Bytes
Versions: 4
Compression:
Stored size: 657 Bytes
Contents
module ReverseAsciidoctor module Converters class Img < Base def convert(node, state = {}) alt = node['alt'] src = node['src'] id = node['id'] width = node['width'] height = node['height'] anchor = id ? "[[#{id}]]\n" : "" title = extract_title(node) title = ".#{title}\n" unless title.empty? attrs = alt attrs = "\"\"" if (width || height) && alt.nil? attrs += ",#{width}" if width attrs += ",#{height}" if width && height [anchor, title, "image::", src, "[", attrs, "]"].join("") end end register :img, Img.new end end
Version data entries
4 entries across 4 versions & 1 rubygems