Fancybox 3 using Figcaption Legends

By default Fancybox 3 uses picture legends from the option data-caption="Bildlegende" and doesn't support HTML formatted text. Using JQuery one can juse the legend from the HTML 5 tag <figcaption>. Nested <figure> are supported. The example shown in the original Fancybox 3 is wrong, because there the <a> anchor tag encloses the whole <figcaption>, which reports as wrong.

  <a href="/path/to/fullsize-picture.jpg" data-fancybox="fig">
    <img src="/path/to/thumbnail.jpg" width="100" height="100" alt="Picture" />
    HTML formatierte Bildlegende mit <a href="#">Hyperlink.</a>.

    caption : function(instance,item) {
      return $(this).closest('figure').find('figcaption').html();