Closed mdroidian closed 8 months ago
Welcome @mdroidian! Sorry you ran into confusion.
CommonMark, the markdown standard this project follows wraps images in paragraph tags.
Either account for this in your styles. Or apply https://github.com/remarkjs/remark-unwrap-images to change the document structure to remove the paragraphs.
Hi! This was closed. Team: If this was fixed, please add phase/solved
. Otherwise, please add one of the no/*
labels.
Hi! Thanks for reaching out! Because we treat issues as our backlog, we close issues that are questions since they don’t represent a task to be completed.
See our support docs for how and where to ask questions.
Thanks, — bb
@ChristianMurphy Thanks for the quick reply! 🙌 I'll give it a go tomorrow.
@mdroidian do you get console errors when the paragraph content contains strong
or other elements?
I don't know how to fix it. I wonder if I need to add recursion
@vasco3 that is unrelated to the question here. Please open a new discussion https://github.com/orgs/remarkjs/discussions/categories/q-a and include enough context that people can actually help you. Like what you are building, what the markdown content you are processing looks like, what versions of libraries and build tools you are using are, and what the actual warning or error you see is.
Initial checklist
Affected packages and versions
"react-markdown": "^9.0.1", "remark-gfm": "^4.0.0"
Link to runnable example
No response
Steps to reproduce
minimal vite app with react-pdf pass content to
node: v18.17.0 npm: 9.6.7
Expected behavior
Images adhere to
objectFit: "contain"
Text is renderedActual behavior
Images are all tiny
If I remove the
p
component, images adhere toobjectFit: "contain"
, but no text is shownI am curious as to why this is the case. How can I have images adhere to
img
and notp
Runtime
Other (please specify in steps to reproduce)
Package manager
Other (please specify in steps to reproduce)
OS
Windows
Build and bundle tools
Vite