lambda-packages icon indicating copy to clipboard operation
lambda-packages copied to clipboard

🐛 BUG: `<p>`-tags spread over multiple lines in Markdown generate multiple `<p>`-tags

Open andygrunwald opened this issue 3 years ago • 4 comments

What version of astro are you using?

1.0.0-beta.47

Are you using an SSR adapter? If so, which one?

No

What package manager are you using?

npm

What operating system are you using?

Linux

Describe the Bug

When you clone the Astro Starter Kit: Blog with Multiple Authors example and add the following content to a blog post (like pages/post/chapter-i.md):

<p>
  THIS IS HELLO
  <a href="https://google.com">
    Link
  </a>
</p>

Astro generates content like

<p>THIS IS HELLO</p><a href="https://google.com/"><p>Link</p></a>

See screenshot: Screenshot from 2022-06-19 13-20-05

Expected result

Output generation like

<p>THIS IS HELLO <a href="https://google.com/">Link</a></p>

This bug might be very similar to https://github.com/withastro/astro/issues/3529

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-ldex7c?file=src/pages/post/chapter-i.md

Participation

  • [ ] I am willing to submit a pull request for this issue.

andygrunwald avatar Jun 19 '22 11:06 andygrunwald

Writing the HTML like

<p>THIS IS HELLO<a href="https://google.com">Link</a></p>

produces the expected output.

andygrunwald avatar Jun 19 '22 11:06 andygrunwald

I think by default the markdown parser will parse any text intro <p> tag.

Try use

THIS IS HELLO [Hello](https://google.com)

preview: Hello

as workaround.

Also I think you can configure remake parser manually to avoid this behavior.

X7md avatar Jun 19 '22 15:06 X7md

@X7md Any hint where or how I can configure this?

andygrunwald avatar Jun 21 '22 06:06 andygrunwald

@X7md Any hint where or how I can configure this?

See my project.

https://github.com/X7md/mushkhbat/blob/main/astro.config.mjs

I actually configuration it using some plug-in for markdown

X7md avatar Jun 21 '22 09:06 X7md