Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should not use div wrapper #115

Open
willin opened this issue Jan 31, 2022 · 2 comments
Open

should not use div wrapper #115

willin opened this issue Jan 31, 2022 · 2 comments

Comments

@willin
Copy link

willin commented Jan 31, 2022

When i use the component in markdown or mdx, the generated codes a bit like:

<p>
    <div class="rc-image" style="width: 200px;">
        <img class="rc-image-img" src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png" />
    </div>
</p>

However, the P element represents a paragraph. It cannot contain block-level elements (including P itself).

@rickyzhangca
Copy link

rickyzhangca commented Mar 21, 2022

another downside of the current wrapper handling is that the classnames are trapped on the <img> instead of transferred to the wrapper, so the styling is difficult - especially if you use tailwindcss, you'll need to add another wrapper yourself

image

@afc163
Copy link
Member

afc163 commented Aug 8, 2022

How about adding a component="div" for customization?

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

No branches or pull requests

3 participants