- <% balloon = elm.balloons.first %>
- <div id="vballoon<%= elm.id -%>" class="pettanr-comic-balloon" style="width:<%= balloon.width -%>px; height:<%= balloon.height -%>px; top:<%= balloon.y -%>px; left:<%= balloon.x -%>px; z-index:<%= elm.z -%>; ">
- <img src="<%= balloon.system_picture.url -%>" alt="<%= balloon.caption -%>">
- <% elm.speeches.each do |speech| %>
- <p style="top:<%= speech.y -%>px; left:<%= speech.x -%>px;width:<%= speech.width -%>px; height:<%= speech.height -%>px;">
- <span><%= h speech.content -%></span>
- </p>
- <% end %>
+ <% next unless elm.balloon or elm.speech %>
+ <div id="<%= elm.tag_id -%>" panel_id="<%= elm.tag_panel_id -%>" element_id="<%= elm.tag_element_id -%>" element_type="<%= elm.tag_element_type -%>" balloon_id="<%= elm.balloon.tag_element_id -%>" speech_id="<%= elm.speech.tag_element_id -%>" class="pettanr-comic-balloon" style="width:<%= elm.balloon.width -%>px; height:<%= elm.balloon.height -%>px; top:<%= elm.balloon.y -%>px; left:<%= elm.balloon.x -%>px; z-index:<%= elm.z -%>; ">
+ <img id="<%= elm.balloon.tag_id -%>" panel_id="<%= elm.balloon.tag_panel_id -%>" element_id="<%= elm.balloon.tag_element_id -%>" element_type="<%= elm.balloon.tag_element_type -%>" element_part_id="<%= elm.balloon.tag_element_part_id -%>" element_part_type="<%= elm.balloon.tag_element_part_type -%>" class="pettanr-balloon" src="<%= elm.balloon.system_picture.url -%>" alt="<%= elm.caption -%>">
+ <p style="top:<%= elm.speech.y -%>%; left:<%= elm.speech.x -%>%;width:<%= elm.speech.width -%>%; height:<%= elm.speech.height -%>%;">
+ <span id="<%= elm.speech.tag_id -%>" panel_id="<%= elm.speech.tag_panel_id -%>" element_id="<%= elm.speech.tag_element_id -%>" element_type="<%= elm.speech.tag_element_type -%>" element_part_id="<%= elm.speech.tag_element_part_id -%>" element_part_type="<%= elm.speech.tag_element_part_type -%>"><%= sanitize(h(elm.speech.content).gsub(/\n/, '<br>'), :tags => %w(a p br)) -%></span>
+ </p>