In the "What went wrong?" exercise, there is a warning about line numbers in error messages potentially not matching source code line numbers due to code injection from extensions like live-server.
This is a result of the code's script tag being placed after the closing body tag, so live-server's injected code comes before it.
By placing the script tag before the closing body tag, live-server injects code after it, preserving line numbers in the error messages, making the lesson much easier to follow for more people. The relevant warning can then be removed from the lesson.
Moves the closing body tag down after the script tag closes.
Fixes inconsistent indentation across the file to only use 2 spaces per level (rather than mixing spaces and tabs).
Uses appropriate indentation for each block as necessary.
Additional information
This PR depends on (https://github.com/mdn/content/pull/36541) which amends the line number references and screenshots in the lesson itself to match what these code changes will produce.
Because
In the "What went wrong?" exercise, there is a warning about line numbers in error messages potentially not matching source code line numbers due to code injection from extensions like live-server.
This is a result of the code's script tag being placed after the closing body tag, so live-server's injected code comes before it.
By placing the script tag before the closing body tag, live-server injects code after it, preserving line numbers in the error messages, making the lesson much easier to follow for more people. The relevant warning can then be removed from the lesson.
This has been tested with VSCode's Live Server extension, VSCode's Live Preview extension and the live-server npm package.
This PR
Additional information
This PR depends on (https://github.com/mdn/content/pull/36541) which amends the line number references and screenshots in the lesson itself to match what these code changes will produce.