code: def test_convert_caption_to_figure(self):
      def r(f):
          with open(f, encoding="utf-8") as infile:
              return infile.read()
  
      silent_f2p = mute(True)(fields2pelican)
      test_post = filter(
          lambda p: p[0].startswith("Caption on image"), self.posts
      )
      with temporary_folder() as temp:
          md = [r(f) for f in silent_f2p(test_post, "markdown", temp)][
              0
          ]
  
      caption = re.search(r"\[caption", md)
      self.assertFalse(caption)
  
      for occurence in [
          "/theme/img/xpelican.png.pagespeed.ic.Rjep0025-y.png",
          "/theme/img/xpelican-3.png.pagespeed.ic.m-NAIdRCOM.png",
          "/theme/img/xpelican.png.pagespeed.ic.Rjep0025-y.png",
          "This is a pelican",
          "This also a pelican",
          "Yet another pelican",
      ]:
          # pandoc 2.x converts into ![text](src)
          # pandoc 3.x converts into <figure>src<figcaption>text</figcaption></figure>
          self.assertIn(occurence, md)
  
imports: import os
  import re
  from posixpath import join
  from unittest.mock import patch
  from pelican.settings import DEFAULT_CONFIG
  from pelican.tests.support import mute, skipIfNoExecutable, temporary_folder, unittest, TestCaseWithCLocale
  from pelican.tools.pelican_import import blogger2fields, build_header, build_markdown_header, decode_wp_content, download_attachments, fields2pelican, get_attachments, tumblr2fields, wp2fields
  from pelican.utils import path_to_file_url, slugify
label_desc: Use image node_id 18 for calling the TestWordpressXmlImporter obj's underlying member method code with example usage: obj.test_convert_caption_to_figure() and returns: infile