Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

Pretty XML Formatter

Package Overview
Maintainers
0
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry
This package was compromised as part of the ongoing "GlassWorm v2" supply chain attack.

Affected versions:

6.4.2
View campaign page

Pretty XML Formatter

Pretty XML Formatter extension for Visual Studio Code. Formats XML documents just like Visual Studio.

unpublished
Open VSX
Version
6.4.2
Version published
Maintainers
0
Created
Source
logo

Pretty XML Formatter

Format and beautify any XML document directly in Visual Studio Code and VSCodium. Modern formatting. Flexible settings. Fast and visually clear results.


Overview

Pretty XML Formatter is an extension for Visual Studio Code and VSCodium designed to quickly clean up and beautify XML files.
It brings clear, consistently formatted XML using a modern, transparent set of rules—just as you see in Visual Studio.

Works perfectly with:

  • .xml, .xaml, .axml, .xsd, .xsl, .plist, .mobileconfig, .config, .csproj, .svg, .resx and any other XML-based files.

A version for Visual Studio for Mac is also available. Suggestions and contributions are welcome!

Features

⚡ Prettify XML

Just right-click and choose Prettify XML or use the keyboard shortcut.

  • Each attribute on a new line for clarity
  • First attribute stays on the same line as the element start tag
  • All attributes neatly aligned
  • If an element has no children, gets a self-closing tag
  • Eliminates empty lines for compactness
  • Full support for single quotes and Unicode whitespace in attribute values

✂️ Format Selection

  • Format an entire document or any selection—even partial/incomplete XML!
  • Handy for fixing snippets or large files in bulk.

Example:

🔽 Minimize XML

  • Compresses and reduces XML to its single-line minimal form with one click.

Minimize

🎨 Highly Configurable

  • Loads of settings for indentation, spacing, attribute alignment, comment formatting, and much more!

Settings Screenshot

Keyboard Shortcuts

CommandPlatformShortcut
Prettify XMLMacCmd+K L
Prettify XMLWin, LinuxCtrl+K L
Minimize XMLMac`Cmd+K ``
Minimize XMLWin, Linux`Ctrl+K ``

Tip:
You can change shortcuts in Preferences → Keyboard Shortcuts.

Settings

All settings are available for the Prettify XML command.

Setting KeyDefaultDescription
indentSpaceLength4Number of spaces for indentation
useSingleQuotesfalseUse ' instead of " for attributes
useSelfClosingTagtrueUse self-closing tags if no children
formatOnSavefalseEnable format on save
allowSingleQuoteInAttributeValuetrueAllow ' in attribute values
addSpaceBeforeSelfClosingTagtrueAdds space before />
wrapCommentTextWithSpacestrueWrap comment text with single space
allowWhiteSpaceUnicodesInAttributeValuestrueAllow whitespace Unicode chars in attributes
positionFirstAttributeOnSameLinetrueFirst attribute on the same line
positionAllAttributesOnFirstLinefalseAll attributes on the first line
preserveWhiteSpacesInCommentfalsePreserve whitespace in comments
addSpaceBeforeEndOfXmlDeclarationfalseExtra space before end of XML declaration
addXmlDeclarationIfMissingtrueAdd XML declaration if missing
attributesInNewlineThreshold1Threshold to push attributes onto new lines
enableLogsfalseDisplay logs in the output
wildCardedExceptionsForPositionAllAttributesOnFirstLine[]Which elements ignore 'all on first line' rule (use wildcard patterns)
addEmptyLineBetweenElementsfalseAdd empty line if there are >2 children

🛠️ Example Screenshots

Screenshot Settings

Requirements

Installation

Known Issues

  • Currently supports valid XML only, limited DTD handling.

Found a bug? Report in the issues.

More Info

Keywords

__ext_axaml

FAQs

Package last updated on 10 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts