Sha256: b77dd5ac617dbb89aa9fea8d17c7124b9563a6c5cb9c95fb71fab7bd69b95201
Contents?: true
Size: 555 Bytes
Versions: 44
Compression:
Stored size: 555 Bytes
Contents
module RedCloth::Formatters::HTML def after_transform(text) # Asset Links text.gsub! /\[asset\(([^\)]+)\)\]/ do |s| asset_id, size = $1.split('|') asset = Asset.find_by_id(asset_id) return if asset.nil? html = "<a href=\"#{asset.public_filename}\" class=\"fancybox\" rel=\"group\">" if asset.is_image? html << "<img src=\"#{asset.public_filename(size)}\" alt=\"#{asset.description}\" />" else html << asset.description.titleize end html << '</a>' end text.chomp! end end
Version data entries
44 entries across 44 versions & 1 rubygems