def render_image(image)
      id_attr = image.id ? %{ id="attachment_#{image.id}"} : ""
      lines = []
      lines << %{<figure#{id_attr} class="image embedded">}
      lines << %{<div class="img"><img src="#{encode(image.url)}" alt="#{encode(image.alt_text)}"></div>}
      lines << image.figcaption_html if image.figcaption?
      lines << '</figure>'
      lines.join
    end
def render_image(image)
      id_attr = image.id ? %{ id="attachment_#{image.id}"} : ""
      lines = []
      lines << %{<figure#{id_attr} class="image embedded">}
      lines << %{<div class="img"><img src="#{encode(image.url)}" alt="#{encode(image.alt_text)}"></div>}
      lines << image.figcaption_html if image.figcaption?
      lines << '</figure>'
      lines.join
    end
As of version 1.12.0 of Kramdown the block elements (div & figcaption)
 inside this html block will have it's < > converted into HTML Entities
 when ever this code is used inside block level elements.

 To resolve this we have a post-processing task that will convert this
 back into HTML (I know - it's ugly). The way we could resolve this
 without ugliness would be to output only inline elements which rules
 out div and figcaption

 This issue is not considered a bug by kramdown: https://github.com/gettalong/kramdown/issues/191