hexo-renderer-marked icon indicating copy to clipboard operation
hexo-renderer-marked copied to clipboard

Parse figcaption contents

Open neverbot opened this issue 9 months ago • 2 comments

Check List

  • [X] I have already read README.
  • [X] I have already searched existing issues.
  • [X] I have already searched existing pull requrests.

Feature Request

When using the figcaption option,

marked:
  figcaption: true

generating images as

<figure>
  <img ... >
  <figcaption>...</figcaption>
</figure>

the figcaptions are usually intended to be rendered in some fancy way, including links or styles, etc.

I think it would be useful to parse its contents, changing from:

      return `<figure>${out}<figcaption aria-hidden="true">${text}</figcaption></figure>`;

to

      return `<figure>${out}<figcaption aria-hidden="true">${marked.parse(text)}</figcaption></figure>`;

If the figcaption has no special markdown, there is no difference. If we include some kind of markdown content, it will be parsed.

Additional context

No response

neverbot avatar May 07 '24 20:05 neverbot