On my list of Visual Studio Code extensions to try (after I change the shortcuts, as direct Alt shortcuts are not a good idea, luckily those are configurable)
VSCode extension that checks for broken links in an HTML, XML, RSS, PHP, or Markdown file.
…
Checks currently open file:
for broken links in anchor-href, link-href, img-src, and script-src tags in currently-open HTML or PHP file
both clearnet and onion (Tor) links
for badly-formatted mailto links, and duplicate local anchors (anchor-name, anchor-id)
for working HTTPS equivalents of HTTP links
Optionally checks for invalid characters and common mistakes (missing tag content, empty attribute value, more).
Also checks for errors in a small subset of semantic HTML tags (in HTML and PHP files): checks that each page has header, main, footer; checks that each heading is inside a section, article, or aside; checks that each section/article/aside has exactly one heading in it; checks that heading values are nested properly.
…
To see/change settings for this extension, open Settings (Ctrl+,) / Extensions / “HTML / XML / RSS link checker”.
To change the key-combinations for this extension, open File / Preferences / Keyboard Shortcuts and search for Alt+H or Alt+T or Alt+M or Alt+L.
A long time ago, I found out that by default, you could only format td elements in HTML tables: somehow doing that with just tr failed, and I never understood why.
Since I wasn’t doing a lot of html stuff back then, I just lived with the few occurrences and moved on.
You can set border properties on a tr element, but according to the CSS 2.1 specification, such properties have no effect in the separated borders model, which tends to be the default in browsers. Ref.: 17.6.1 The separated borders model. (The initial value of border-collapse is separate according to CSS 2.1, and some browsers also set it as default value for table. The net effect anyway is that you get separated border on almost all browsers unless you explicitly specifi collapse.)
Thus, you need to use collapsing borders. Example:
There are two distinct models for setting borders on table cells in CSS. One is most suitable for so-called separated borders around individual cells, the other is suitable for borders that are continuous from one end of the table to the other. Many border styles can be achieved with either model, so it is often a matter of taste which one is used.
This property selects a table’s border model. The value ‘separate‘ selects the separated borders border model. The value ‘collapse‘ selects the collapsing borders model. The models are described below.
You can now use F2 to rename the opening/closing tag pairs in HTML.
F2 when the cursor is over one of the tags and you will get a little input box with the cursor to input the new tag name and the start/end tags will be replaced with whatever you type upon .
[Wayback/Archive.is] Another answer indicates that even more recently, Linked Editing can do the same without even pressing F2. Too bad it is not enabled by default:
No need for extension, this is now cooked into VSCode.
I come from a background of Delphi, Visual Studio and Notepad++ editors that historically have expanded their functionality over decades of releases.
When switching much of my development to Visual Studio Code, which out of the box aims at basic support (which has grown remarkably over the years so it’s way beyond basic now), I decided to review my editing behaviours see if plugins (in vscode speak “extensions marketplace“) would assist me with that.
One of my behaviours I wanted to get rid of is heavily use of keyboard macros, so when doing more web-stuff, I bumped into Emmet (that in the past was called Zen Code).
A while ago, I wanted to convert the dl delimited list htmlelement on a web page into a regular table so I could more easily reorder the data into cells.
So I ran the below bit of code in the Chrome Console after first putting the mentioned table with id here_table in the place where I wanted the table to be included:
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
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
The content of the JQueryfibookmarklet is in the below gist:
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
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
javascript:(function(){var el=document.createElement("div"),b=document.getElementsByTagName("body")[0],otherlib=!1,msg="";el.style.position="fixed",el.style.height="32px",el.style.width="220px",el.style.marginLeft="-110px",el.style.top="0",el.style.left="50%",el.style.padding="5px 10px",el.style.zIndex=1001,el.style.fontSize="12px",el.style.color="#222",el.style.backgroundColor="#f99";function showMsg(){var txt=document.createTextNode(msg);el.appendChild(txt),b.appendChild(el),window.setTimeout(function(){txt=null,typeof jQuery=="undefined"?b.removeChild(el):(jQuery(el).fadeOut("slow",function(){jQuery(this).remove()}),otherlib&&(window.$jq=jQuery.noConflict()))},2500)}if(typeof jQuery!="undefined")return msg="This page already using jQuery v"+jQuery.fn.jquery,showMsg();typeof $=="function"&&(otherlib=!0);function getScript(url,success){var script=document.createElement("script");script.src=url;var head=document.getElementsByTagName("head")[0],done=!1;script.onload=script.onreadystatechange=function(){!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")&&(done=!0,success(),script.onload=script.onreadystatechange=null,head.removeChild(script))},head.appendChild(script)}getScript("http://code.jquery.com/jquery.min.js",function(){return typeof jQuery=="undefined"?msg="Sorry, but jQuery was not able to load":(msg="This page is now jQuerified with v"+jQuery.fn.jquery,otherlib&&(msg+=" and noConflict(). Use $jq(), not $().")),showMsg()})})();