code: def parse_image_spec(spec):
      
  
      # I was having trouble coming up with a single RE that did it right,
      # so let's just break it down into sub-problems. First, parse out the
      # alt text...
      match = re.match(r'(.+)\s+\"(.*)\"\s*$', spec)
      if match:
          spec, title = match.group(1, 2)
      else:
          title = None
  
      # and now parse out the arglist
      match = re.match(r'([^\{]*)(\{(.*)\})\s*$', spec)
      if match:
          spec = match.group(1)
          args = parse_arglist(match.group(3))
      else:
          args = {}
  
      return spec, args, (title and html.unescape(title))
docs: Parses out a Publ-Markdown image spec into a tuple of path, args, title