Socket
Socket
Sign inDemoInstall

postcss-html

Package Overview
Dependencies
Maintainers
4
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-html - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

10

lib/html/extract-styles.js

@@ -7,2 +7,3 @@ "use strict";

const SvelteTokenizer = require("./svelte-tokenizer");
const { cssSafeSyntax } = require("../syntax/syntaxes");

@@ -129,2 +130,3 @@ function iterateCode(source, { onStyleTag, onStyleAttribute, svelte }) {

);
const svelte = opts.from && /\.svelte$/i.test(opts.from);

@@ -147,3 +149,7 @@ function onStyleTag(style) {

if (/\{[\s\S]*?\}/.test(style.content)) {
style.syntax = buildTemplateSyntax(resolveSyntax());
style.syntax = buildTemplateSyntax(
resolveSyntax("css", {
defaultSyntax: svelte ? cssSafeSyntax : undefined,
})
);
style.lang = "custom-template";

@@ -160,3 +166,3 @@ } else {

onStyleAttribute,
svelte: opts.from && /\.svelte$/i.test(opts.from),
svelte,
});

@@ -163,0 +169,0 @@

11

lib/syntax/build-syntax-resolver.js

@@ -52,4 +52,5 @@ "use strict";

return function resolve(baseLang) {
return function resolve(baseLang, baseOptions) {
let lang = baseLang || "css";
const options = baseOptions || {};

@@ -70,3 +71,3 @@ const cwd = process.cwd();

if (typeof syntax === "string") {
const syntaxModule = loadFromString(syntax);
const syntaxModule = loadFromString(syntax, options);
if (syntaxModule) {

@@ -93,3 +94,3 @@ return syntaxModule;

return cssSyntax;
return options.defaultSyntax || cssSyntax;
};

@@ -111,5 +112,5 @@ };

function loadFromString(syntax) {
function loadFromString(syntax, options) {
if (syntax === "postcss") {
return cssSyntax;
return options.defaultSyntax || cssSyntax;
}

@@ -116,0 +117,0 @@ if (syntax === "postcss-safe-parser") {

{
"name": "postcss-html",
"version": "1.4.0",
"version": "1.4.1",
"publishConfig": {

@@ -5,0 +5,0 @@ "access": "public"

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