lib/jsduck/class_formatter.rb in jsduck-3.4.0 vs lib/jsduck/class_formatter.rb in jsduck-3.4.1

- old
+ new

@@ -29,11 +29,11 @@ cls[group].each_pair do |type, members| # format all members cls[group][type] = members.map {|m| format_member(m) } end end - cls[:html_meta] = format_meta_data(cls[:meta]) + cls[:html_meta] = format_meta_data(cls) cls end def format_member(m) @formatter.doc_context = m[:files][0] @@ -47,11 +47,11 @@ m[:html_type] = (@include_types && !is_css_tag) ? format_type(m[:type]) : m[:type] if m[:type] m[:params] = m[:params].map {|p| format_item(p, is_css_tag) } if m[:params] m[:return] = format_item(m[:return], is_css_tag) if m[:return] m[:properties] = m[:properties].map {|b| format_item(b, is_css_tag) } if m[:properties] - m[:html_meta] = format_meta_data(m[:meta]) + m[:html_meta] = format_meta_data(m) m end def expandable?(m) m[:params] || (m[:properties] && m[:properties].length > 0) || m[:default] || m[:meta][:deprecated] || m[:meta][:template] @@ -77,13 +77,17 @@ end type end end - def format_meta_data(meta_data) + def format_meta_data(context) result = {} - meta_data.each_pair do |key, value| - result[key] = MetaTagRegistry.instance[key].to_html(value) if value + context[:meta].each_pair do |key, value| + if value + tag = MetaTagRegistry.instance[key] + tag.context = context + result[key] = tag.to_html(value) + end end result end end