English | 日本語
Strip HTML/XML markup from the selected text in Visual Studio Code, leaving just the text.

Features
- Removes tags, comments, doctype and processing instructions from every selection — multi-cursor selections included — as a single undoable edit.
- Converts HTML to plain text by default:
<script> and <style> elements are dropped together with their contents, character references such as &, <, and — are decoded, and <br> becomes a line break. Each of these can be switched off (see Settings).
- Text that is not markup is not changed. This includes comparisons such as
a < b and any > inside comments or attribute values. CDATA sections keep their contents.
- Works with XML as well as HTML, including non-ASCII element names.
Usage
- Select the text that contains markup. Multiple cursors are supported.
- Open the Command Palette (
Ctrl+Shift+P, or Cmd+Shift+P on macOS) and run Remove Markup Tags. The command is listed only while something is selected.
- Each selection is replaced by its text content and the selection is cleared. Use Undo to restore the original text.
To bind a key, add a shortcut for extension.removeMarkupTags in Keyboard Shortcuts (Ctrl+K Ctrl+S).
Settings
| Setting |
Default |
Description |
removeMarkupTags.removeScriptAndStyleContent |
true |
Drop <script> and <style> elements together with their contents, not just their tags. |
removeMarkupTags.decodeEntities |
true |
Decode < > & " ' and numeric character references after removing tags. |
removeMarkupTags.replaceLineBreaks |
true |
Replace <br> with a line break (matching the document's end-of-line sequence) instead of removing it. |
All of them can be overridden per language — for example, to keep character references intact while editing HTML source:
"[html]": {
"removeMarkupTags.decodeEntities": false
}
Limitations
The extension works on the text itself rather than parsing it as a document:
- Only the named character references listed above are decoded; others such as
© are left as written. Numeric references always work.
- For a
<script> or <style> element without a closing tag, only the opening tag is removed; its contents remain.
- Any text in the form of a tag is removed, including
<T> in generic code.
Installation
Search for Remove Markup Tags in the Extensions view (Ctrl+Shift+X), or open Quick Open (Ctrl+P) and run ext install zero3.vscode-rmt.
Development
pnpm install
pnpm test # compile, lint, and run the Jest suite
Press F5 to launch an Extension Development Host with a sample file open.
License
MIT