question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Images wrapped in <p> tags

See original GitHub issue

Version

@nuxt/content: v1.2.0 nuxt: v2.12.0

Reproduction Link

https://codesandbox.io/s/nuxtcontent-demo-pfror?file=/content/index.md

Steps to reproduce

Any markdown with an image

![](https://cdn-images-1.medium.com/max/1280/1*tBJ7iUluy2Yhobd6qGUKQA.png)
``

### What is Expected?
I would not expect markdown images to be wrapped in paragraph tags

### What is actually happening?
Markdown images are wrapped in <p> tags.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

3reactions
thelycommented, May 31, 2020

This is an aspect of Markdown, not nuxt/content. Content uses remark plugins to process Markdown text - it looks like there’s a plugin called remark-unwrap-images that does exactly what you’re looking for.

Here’s the whole list of remark plugins, for reference. And here’s the Configuration page of the nuxt/content documentation on how to enable them.

0reactions
shash7commented, Jun 4, 2020

I’m using 1.0.0 Guess that explains the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Images in p tags? - HTML & CSS - SitePoint Forums
Hi all, is it ok to have images in your code not in p tags, ... And if the image is used in-line,...
Read more >
html - In Markdown, is there a way to stop images from being ...
The problem is that the generator is automatically wrapping every line in paragraph tags. line <img> line. becomes <p>line</p> ...
Read more >
How to stop images from being wrapped in <p> tags?
this is a function, that unwraps images from p tags inside the_content /** * WP: Unwrap images from <p> tag * @param $content...
Read more >
Wrapping drupal-media image in a link produces empty P tags ...
There's an issue when linking a media item in the editor whereby it adds empty P tags. It seems to happen when the...
Read more >
Should IMG tag be placed in a P tag... in HTML5... in 2020
The image element, being an inline tag, used to be placed inside a P tag, which is a block element. That was in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found