Socket
Socket
Sign inDemoInstall

svelte-preprocess

Package Overview
Dependencies
Maintainers
1
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-preprocess - npm Package Compare versions

Comparing version 2.4.1 to 2.4.2

9

CHANGELOG.md

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

#### [v2.4.1](https://github.com/kaisermann/svelte-preprocess/compare/v2.4.0...v2.4.1)
#### [v2.4.2](https://github.com/kaisermann/svelte-preprocess/compare/v2.4.0...v2.4.2)
> 2 November 2018
> 3 November 2018
- Accept custom language transformers (#11) [`6abbea1`](https://github.com/kaisermann/svelte-preprocess/commit/6abbea1180df92c7e583d60ae059524ae5261d00)
- Update changelog [`a8d617f`](https://github.com/kaisermann/svelte-preprocess/commit/a8d617f30becea8df442d5a1ce92a4d917f0c861)
- allow ignoring of certain tags [`dc07802`](https://github.com/kaisermann/svelte-preprocess/commit/dc0780214e76ec9a0ef7d30234cfb6ed423967bd)
- fix readme [`a3f4de8`](https://github.com/kaisermann/svelte-preprocess/commit/a3f4de80fcd18f0cb5ad41c8387a59c83bb56e4d)
- Preserve aliased languages as well [`d41f2d0`](https://github.com/kaisermann/svelte-preprocess/commit/d41f2d04da8a64a3c584faf964b718cb590585de)

@@ -15,0 +16,0 @@ #### [v2.4.0](https://github.com/kaisermann/svelte-preprocess/compare/v2.3.1...v2.4.0)

{
"name": "svelte-preprocess",
"version": "2.4.1",
"version": "2.4.2",
"license": "MIT",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -85,2 +85,3 @@ # Svelte Preprocess

* <... type="text/customLanguage">
* <... type="application/customLanguage">
* will be treated as the language 'customLanguage'

@@ -90,2 +91,10 @@ */

],
preserve: [
/**
* Using the same matching algorithm as above, don't parse,
* modify, or remove from the markup, tags which match the
* language / types listed below.
* **/
'ld+json'
]
}

@@ -92,0 +101,0 @@

@@ -18,3 +18,8 @@ const stripIndent = require('strip-indent')

module.exports = ({ onBefore, transformers = {}, aliases } = {}) => {
module.exports = ({
onBefore,
transformers = {},
aliases,
preserve = [],
} = {}) => {
const optionsCache = {}

@@ -54,2 +59,6 @@

if (preserve.includes(lang) || preserve.includes(alias)) {
return
}
if (attributes.src) {

@@ -56,0 +65,0 @@ if (attributes.src.match(/^(https?)?:?\/\/.*$/)) {

@@ -69,3 +69,3 @@ const { readFileSync } = require('fs')

lang = attributes.type
? attributes.type.replace('text/', '')
? attributes.type.replace(/^(text|application)\/(.*)$/, '$2')
: attributes.lang || defaultLang

@@ -72,0 +72,0 @@ }

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