DEV Community

loading...

Discussion on: Create a blog with Sapper & Markdown

Collapse
jssteinberg profile image
Johan

This helped me! Do you know a way to wrap images from markdown in figure, not p?

Collapse
joshnuss profile image
Joshua Nussbaum Author

Glad it helped :)

I think the p tag comes from having an empty line before defining the image. It's not the image that causes the p tag.

One workaround is to <figure> tag inside markdown. HTML tags are allowed in markdown.

Otherwise you'll have to look at modifying the markdown parser, or finding one that has a configurable option for this.

Collapse
jssteinberg profile image
Johan

Well the p tag will wrap either only the image, or the image and other inline elements.

Thanks. I was guessing I had to find another parser. markdown-it seems like the most active -- plugin wise ...

Thread Thread
joshnuss profile image
Joshua Nussbaum Author

Welcome.

Try forking the markdown rollup plugin and switching showdown to markdown-it. That should do it.