src/attributes.erb in rtfdoc-0.1.4 vs src/attributes.erb in rtfdoc-0.1.5
- old
+ new
@@ -10,11 +10,11 @@
<% end %>
</div>
<div class="list-item-description">
<%= to_html(hash['desc']) %>
</div>
- <% if hash['children']&.any? %>
+ <% if hash.key?('children') || hash.key?('after_children') %>
<div class="section-list section-list-child">
<h5
class="section-list-title section-list-title-child"
data-content="Hide child attributes"
>
@@ -24,19 +24,26 @@
</svg>
</span>
<span>Show child attributes</span>
</h5>
<ul class="child-list hidden">
- <% hash['children'].each do |child_name, child_hash| %>
+ <% Array(hash['children']).each do |child_name, child_hash| %>
<li class="list-item">
<div class="list-item-label">
<div class="list-item-name"><%= child_name %></div>
<div class="list-item-type"><%= child_hash['type'] %> </div>
</div>
<div class="list-item-description">
<%= to_html(child_hash['desc']) %>
</div>
</li>
+ <% end %>
+ <% if (str = hash['after_children']) %>
+ <li class="list-item">
+ <div class="list-item-description">
+ <%= to_html(str) %>
+ </div>
+ </li>
<% end %>
</ul>
</div>
<% end %>
</li>