class Kramdown::Converter::Pdf
def text_hash(text, opts, squeeze_whitespace = true)
The +text+ parameter is used as value for the :text key and if +squeeze_whitespace+ is
Helper function that returns a hash with valid "formatted text" options.
def text_hash(text, opts, squeeze_whitespace = true) text = text.gsub(/\s+/, ' ') if squeeze_whitespace hash = {:text => text} [:styles, :size, :character_spacing, :font, :color, :link, :anchor, :draw_text_callback, :callback].each do |key| hash[key] = opts[key] if opts.has_key?(key) end hash end