Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@prettier/plugin-xml

Package Overview
Dependencies
Maintainers
12
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prettier/plugin-xml - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

9

CHANGELOG.md

@@ -9,2 +9,8 @@ # Changelog

## [0.5.0] - 2020-01-21
### Added
- Support for DOCTYPE nodes.
## [0.4.0] - 2020-01-19

@@ -43,3 +49,4 @@

[unreleased]: https://github.com/prettier/plugin-xml/compare/v0.4.0...HEAD
[unreleased]: https://github.com/prettier/plugin-xml/compare/v0.5.0...HEAD
[0.5.0]: https://github.com/prettier/plugin-xml/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/prettier/plugin-xml/compare/v0.3.0...v0.4.0

@@ -46,0 +53,0 @@ [0.3.0]: https://github.com/prettier/plugin-xml/compare/v0.2.0...v0.3.0

4

package.json
{
"name": "@prettier/plugin-xml",
"version": "0.4.0",
"version": "0.5.0",
"description": "prettier plugin for XML",

@@ -22,3 +22,3 @@ "main": "src/plugin.js",

"dependencies": {
"@xml-tools/parser": "^0.4.0",
"@xml-tools/parser": "^1.0.0",
"prettier": ">=1.10"

@@ -25,0 +25,0 @@ },

@@ -83,6 +83,23 @@ const {

},
docTypeDecl: (path, opts, print) => {
const { DocType, Name, externalID, CLOSE } = path.getValue().children;
const parts = [DocType[0].image, " ", Name[0].image];
if (externalID) {
parts.push(" ", path.call(print, "children", "externalID", 0));
}
return group(concat(parts.concat(CLOSE[0].image)));
},
document: (path, opts, print) => {
const { element, misc, prolog } = path.getValue().children;
const { docTypeDecl, element, misc, prolog } = path.getValue().children;
let parts = [];
if (docTypeDecl) {
parts.push({
offset: docTypeDecl[0].location.startOffset,
printed: path.call(print, "children", "docTypeDecl", 0)
});
}
if (prolog) {

@@ -102,5 +119,3 @@ parts.push({

});
}
if (node.children.Comment) {
} else if (node.children.Comment) {
parts.push({

@@ -167,2 +182,31 @@ offset: node.location.startOffset,

},
externalID: (path, _opts, _print) => {
const {
Public,
PubIDLiteral,
System,
SystemLiteral
} = path.getValue().children;
if (System) {
return group(
concat([
System[0].image,
indent(concat([line, SystemLiteral[0].image]))
])
);
}
return group(
concat([
group(
concat([
Public[0].image,
indent(concat([line, PubIDLiteral[0].image]))
])
),
indent(concat([line, SystemLiteral[0].image]))
])
);
},
prolog: (path, opts, print) => {

@@ -169,0 +213,0 @@ const { XMLDeclOpen, attribute, SPECIAL_CLOSE } = path.getValue().children;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc