Sha256: 4d5a6b84d0ec8c300660c2b7a3f1ba7a9c4807fec7a91f4de736a52f666913bf

Contents?: true

Size: 678 Bytes

Versions: 2

Compression:

Stored size: 678 Bytes

Contents

# -*- coding: utf-8 -*-

@tag_uninstall ||= false

theme_exit if @tag_uninstall

match("**", CustomTag) do |tags|
  find_block_element = lambda do |tag|
    element = tag
    while element.inline_element?
      element = element.parent
    end
    element
  end

  find_markup_target = lambda do |tag|
    if tag.elements.empty?
      tag.parent
    else
      tag
    end
  end

  tags.each do |tag|
    case tag.name
    when "center"
      find_block_element.call(tag).horizontal_centering = true
    when "right"
      find_block_element.call(tag).align = "right"
    when "x-large"
      find_markup_target.call(tag).prop_set("size", @x_large_font_size)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rabbit-0.9.1 lib/rabbit/theme/tag/tag.rb
rabbit-0.9.0 lib/rabbit/theme/tag/tag.rb