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

🐛 BUG: HTML doesn't work in markdown #3220

Closed
1 task
daviatkea opened this issue Apr 27, 2022 · 3 comments · Fixed by #3410
Closed
1 task

🐛 BUG: HTML doesn't work in markdown #3220

daviatkea opened this issue Apr 27, 2022 · 3 comments · Fixed by #3410
Labels
- P2: nice to have Not breaking anything but nice to have (priority) feat: markdown Related to Markdown (scope)

Comments

@daviatkea
Copy link

What version of astro are you using?

1.0.0-beta.18

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

None

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

I’m using the built-in component to render HTML from a markdown file. It’s working just fine, but when I put HTML inside the markdown file, it duplicates some of the text content and produces weird spacing. For instance, if I put in content, I get extra spacing around the word “content”, and my other plain text preceding the code-tag is duplicated. It worked when I was able to use {content.astro.html} in an earlier version of Astro.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-ut8fqd

Participation

  • I am willing to submit a pull request for this issue.
@natemoo-re natemoo-re added feat: markdown Related to Markdown (scope) - P2: nice to have Not breaking anything but nice to have (priority) s2-medium and removed bb:investigate labels May 10, 2022
@natemoo-re
Copy link
Member

This seems to be an issue with our Markdown integration, likely coming from the way components are handled in remark. We should take a look at making sure the behavior is consistent between paragraphs with HTML embedded in them and paragraphs with only Markdown.

@natemoo-re natemoo-re linked a pull request May 19, 2022 that will close this issue
natemoo-re added a commit that referenced this issue May 24, 2022
* feat: use internal MDX tooling for markdown + components

* fix: improve MD + component tests

* chore: add changeset

* fix: make tsc happy

* fix(#3319): add regression test for component children

* fix(markdown): support HTML comments in markdown

* fix(#2474): ensure namespaced components are properly handled in markdown pages

* fix(#3220): ensure html in markdown pages does not have extra surrounding space

* fix(#3264): ensure that remark files pass in file information

* fix(#3254): enable experimentalStaticExtraction for `.md` pages

* fix: revert parsing change

* fix: remove `markdown.mode` option
@RobbieTheWagner
Copy link

@natemoo-re I am still getting a broken build when I try to use HTML in markdown. I get this error

Unexpected character `=` (U+003D) before name, expected a character that can start a name, such as a letter, `$`, or `_`

@natemoo-re
Copy link
Member

@natemoo-re I am still getting a broken build when I try to use HTML in markdown. I get this error


Unexpected character `=` (U+003D) before name, expected a character that can start a name, such as a letter, `$`, or `_`

We are tracking a handful of regressions that were introduced by the PR that closed this issue. You can look at the markdown tag to see them. If you don't see any related to your specific problem, please feel free to open a new issue.

I'm going to keep this particular issue closed since the original problem in the PR description has been fixed.

SiriousHunter pushed a commit to SiriousHunter/astro that referenced this issue Feb 3, 2023
* feat: use internal MDX tooling for markdown + components

* fix: improve MD + component tests

* chore: add changeset

* fix: make tsc happy

* fix(withastro#3319): add regression test for component children

* fix(markdown): support HTML comments in markdown

* fix(withastro#2474): ensure namespaced components are properly handled in markdown pages

* fix(withastro#3220): ensure html in markdown pages does not have extra surrounding space

* fix(withastro#3264): ensure that remark files pass in file information

* fix(withastro#3254): enable experimentalStaticExtraction for `.md` pages

* fix: revert parsing change

* fix: remove `markdown.mode` option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority) feat: markdown Related to Markdown (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants