Skip to content

fix(webserver): move <script> blocks inside <head> in default template - #84

Merged
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:fix/script-outside-head
Jun 11, 2026
Merged

fix(webserver): move <script> blocks inside <head> in default template#84
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:fix/script-outside-head

Conversation

@ngosang

@ngosang ngosang commented Jun 11, 2026

Copy link
Copy Markdown
Member

Seven pages of the default web template closed and then emitted a <script> block before opening , which is invalid HTML (no content is allowed between and ). Browsers recover by reparenting the script, but it is a parse error and a trap for further markup work.

Move the closing tag to after the script block so the scripts are declared inside , in:

  • amuleweb-main-dload.php
  • amuleweb-main-search.php
  • amuleweb-main-shared.php
  • amuleweb-main-prefs.php
  • amuleweb-main-log.php
  • amuleweb-main-stats.php
  • footer.php

No script content was changed; this is a purely structural fix. Verified
against a running amuleweb: every affected page now serves
immediately before and renders unchanged.

Five pages of the default web template closed <head> and then emitted a
<script> block before opening <body>, which is invalid HTML (no content
is allowed between </head> and <body>). Browsers recover by reparenting
the script, but it is a parse error and a trap for further markup work.

Move the closing </head> tag to after the script block so the scripts
are declared inside <head>, in:

- amuleweb-main-dload.php
- amuleweb-main-search.php
- amuleweb-main-shared.php
- amuleweb-main-prefs.php
- amuleweb-main-stats.php

footer.php and amuleweb-main-log.php had the same problem but were
already fixed as a side effect of earlier commits removing their
misplaced script blocks entirely.

No script content was changed; this is a purely structural fix. Verified
against a running amuleweb: every affected page now serves </head>
immediately before <body> and renders unchanged.
@ngosang
ngosang force-pushed the fix/script-outside-head branch from 04b9164 to 3020a9e Compare June 11, 2026 08:38
@ngosang
ngosang merged commit d8c72c5 into amule-org:master Jun 11, 2026
8 checks passed
@ngosang
ngosang deleted the fix/script-outside-head branch June 11, 2026 08:51
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

Successfully merging this pull request may close these issues.

1 participant