lib/zafu/markup.rb in zafu-0.7.7 vs lib/zafu/markup.rb in zafu-0.7.8
- old
+ new
@@ -5,10 +5,11 @@
# indentation.
class Markup
EMPTY_TAGS = %w{meta input link img}
STEAL_PARAMS = {
'link' => [:href, :charset, :rel, :type, :media, :rev, :target],
+ 'a' => [:title, :onclick],
'script' => [:type, :charset, :defer],
:other => [:class, :id, :style],
}
# Tag used ("li" for example). The tag can be nil (no tag).
@@ -21,10 +22,12 @@
attr_accessor :done
# Space to insert before tag
attr_accessor :space_before
# Space to insert after tag
attr_accessor :space_after
+ # Keys to remove from zafu and use for the tag itself
+ attr_writer :steal_keys
class << self
# Parse parameters into a hash. This parsing supports multiple values for one key by creating additional keys:
# <tag do='hello' or='goodbye' or='gotohell'> creates the hash {:do=>'hello', :or=>'goodbye', :or1=>'gotohell'}
@@ -248,10 +251,10 @@
def to_s
wrap(nil)
end
def steal_keys
- (STEAL_PARAMS[@tag] || []) + STEAL_PARAMS[:other]
+ @steal_keys || (STEAL_PARAMS[@tag] || []) + STEAL_PARAMS[:other]
end
private
def params_to_html
para = []
\ No newline at end of file