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

Is it possible to not wrap <div> inside <a> in <p> #687

Open
inliquid opened this issue Jul 16, 2021 · 0 comments
Open

Is it possible to not wrap <div> inside <a> in <p> #687

inliquid opened this issue Jul 16, 2021 · 0 comments

Comments

@inliquid
Copy link

As of HTML 5 wrapping block element in <a> is valid HTML.

However this renderer breaks a construction with <a> links, because they will be wrapped in <p>:

MD input:

<a href="/asset/upload/post/2713/789f4b70fb52b581274758966463dd7b.zip" target="_blank"><div class="file-icon file-icon-xl" data-type="zip"></div></a>

HTML output:

<p><a href="/asset/upload/post/2713/789f4b70fb52b581274758966463dd7b.zip" target="_blank" rel="nofollow noopener"><div class="file-icon file-icon-xl" data-type="zip"></div></a></p>

And as a result browser will break everything by parsing it as:

<p><a href="/asset/upload/post/2713/789f4b70fb52b581274758966463dd7b.zip" target="_blank" rel="nofollow noopener"></a></p><div class="file-icon file-icon-xl" data-type="zip"></div><p></p>

Is there a way to make renderer not add <p> around <div> inside <a>?

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

1 participant