fix: modernize HTML sample snippet#304818
Merged
Yoyokrazy merged 2 commits intomicrosoft:mainfrom Mar 27, 2026
Merged
Conversation
Update the built-in HTML sample snippet to follow current web standards and reduce unnecessary boilerplate: - Add lang attribute to <html> tag as first tab stop (W3C recommended) - Remove outdated IE compatibility meta tag (IE is no longer supported) - Remove unnecessary type='text/css' and media='screen' from <link> (default values in HTML5) - Remove <script> tag (modern templates often handle scripts differently) - Move viewport meta before title (following common convention) Fixes microsoft#272331
aeschli
approved these changes
Mar 25, 2026
Yoyokrazy
approved these changes
Mar 25, 2026
|
Oh, this is a brilliant solution! Thank you :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Enhancement / Polish
What is the current behavior?
The built-in
HTML samplesnippet (triggered by typinghtmlin an empty HTML file) contains outdated elements:langattribute on<html>tag (W3C recommends always specifying)<meta http-equiv='X-UA-Compatible' content='IE=edge'>(IE is no longer supported)<link>tag has unnecessarytype='text/css'andmedia='screen'attributes (these are default values in HTML5)<script>tag in<head>(modern practices often defer scripts or handle them differently)Closes #272331
What is the new behavior?
The snippet now produces a cleaner, modern HTML5 template:
Tab stops:
langattribute value (endefault)Additional context
The maintainer (@aeschli) explicitly welcomed a PR for this change: "A pull request is welcome, please change it as you think it is the most useful."
Changes are minimal and focused on removing outdated patterns while adding the commonly expected
langattribute.