-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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: Redundant and incorrect script tag in compiled markdown pages with script in md source. #3254
Labels
- P3: minor bug
An edge case that only affects very specific usage (priority)
feat: markdown
Related to Markdown (scope)
Comments
natemoo-re
pushed a commit
that referenced
this issue
May 19, 2022
natemoo-re
pushed a commit
that referenced
this issue
May 23, 2022
natemoo-re
pushed a commit
that referenced
this issue
May 24, 2022
natemoo-re
pushed a commit
that referenced
this issue
May 24, 2022
natemoo-re
pushed a commit
that referenced
this issue
May 24, 2022
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
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
- P3: minor bug
An edge case that only affects very specific usage (priority)
feat: markdown
Related to Markdown (scope)
What version of
astro
are you using?v1.0.0-beta.20
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 using a script tag in an .md page, a redundant and incorrect script tag will appear in the compiled html.
This redundant script tag has its
src
attribute exactly as it was written in the markdown file. In the final build this path might not point to a file as the file is bundled under a totally different name (entry.xxx.js
).It looks like the Astro compiler/bundler does not correctly remove the original script tag when generating a new one for the bundled js.
It only causes an unnecessary request that returns 404 due to the redundant script tag, the script is in fact bundled correctly in "/entry.157e459c.js" and executes correctly.
Reproduction:
npm run build
dist/test/index.html
(compiled fromsrc/pages/test.md
)src="/src/scripts/test.js"
) that should have been replaced by the astro generated script tag (withsrc="/entry.157e459c.js"
)Link to Minimal Reproducible Example
https://stackblitz.com/github/florian-s-code/astro_tests/tree/main/md_compile
Direct link to github repo for local tests: https://github.com/florian-s-code/astro_tests/tree/main/md_compile (same one as in the stackblitz)
Participation
I have looked at the markdown pipeline but it might happen later in the process, after the markdown has been transformed to an astro component. I was not sure where to investigate.
The text was updated successfully, but these errors were encountered: