Skip to content
This repository has been archived by the owner on Aug 27, 2023. It is now read-only.

Any option to use emphasis inside figcaption? #1

Open
danmondra opened this issue Aug 13, 2023 · 1 comment
Open

Any option to use emphasis inside figcaption? #1

danmondra opened this issue Aug 13, 2023 · 1 comment

Comments

@danmondra
Copy link

Hello, first thanks for creating the plugin, it has been useful for me.
I was wondering if there is any option to use emphasis inside the figcaption, like bold, italic or both?

@naiyerasif
Copy link
Collaborator

naiyerasif commented Aug 13, 2023

This plugin transforms the alt text you specify for images using standard markdown syntax.

![Image](http://url/a.png)

becomes

<figure class="figure">
  <img src="http://url/a.png" alt="Image">
  <figcaption>Image</figcaption>
</figure>

The alt text is treated as plain text by default by Remark and is rendered as such. Straying away from this behavior is out of scope of this plugin.


If you really want to render something in bold or italics in the figcaption, I'd recommend you to use raw HTML in markdown.

<figure class="figure">
  <img src="http://url/a.png" alt="Image">
  <figcaption><em>Emphasized</em> Image</figcaption>
</figure>

If you need to render the captions in bold or italics, you can customize this with CSS.

figcaption {
  font-weight: 700; /* for bold */
  font-style: italic; 
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants