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

Including Doctype in Template File causes duplicate content in output #147

Open
matthew-ia opened this issue Mar 23, 2024 · 1 comment · May be fixed by #145
Open

Including Doctype in Template File causes duplicate content in output #147

matthew-ia opened this issue Mar 23, 2024 · 1 comment · May be fixed by #145
Labels
bug Something isn't working

Comments

@matthew-ia
Copy link
Owner

If you include <!DOCTYPE html> in your __template.svelte file, the content of a page seems to get injected into the output index.html file twice. This is likely a bug related to #120.

@matthew-ia matthew-ia added the bug Something isn't working label Mar 23, 2024
@matthew-ia
Copy link
Owner Author

matthew-ia commented Mar 23, 2024

Yup, this is due to the regex used that is supposed to just get the doctype element, but instead gets the doctype and everything else until the last closing angle brace: >

Bad regex: <!DOCTYPE[\s\S]*>

I think this just needs a lazy modifier at the end, before the right angle brace: ?

Good regex: <!DOCTYPE[\s\S]*?>

@matthew-ia matthew-ia linked a pull request Mar 23, 2024 that will close this issue
matthew-ia added a commit that referenced this issue Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant