Socket
Socket
Sign inDemoInstall

riot-compiler

Package Overview
Dependencies
0
Maintainers
4
Versions
50
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.1.1 to 3.1.2

4

CHANGELOG.md
# Compiler Changes
### v3.1.2
- Fix [riot#2210](https://github.com/riot/riot/issues/2210) : Style tag get stripped from riot tag even if it's in a javascript string.
- Updated devDependencies.
### v3.1.0

@@ -4,0 +8,0 @@ - Adds support for css @apply rule: now ScopedCSS parser can handle it properly

18

dist/es6.compiler.js
/**
* Compiler for riot custom tags
* @version v3.1.1
* @version v3.1.2
*/

@@ -643,9 +643,2 @@

body = body.replace(STYLES, function (_m, _attrs, _style) {
if (included('css')) {
styles += (styles ? ' ' : '') + cssCode(_style, opts, _attrs, url, tagName)
}
return ''
})
body = body.replace(SCRIPTS, function (_m, _attrs, _script) {

@@ -660,2 +653,9 @@ if (included('js')) {

body = body.replace(STYLES, function (_m, _attrs, _style) {
if (included('css')) {
styles += (styles ? ' ' : '') + cssCode(_style, opts, _attrs, url, tagName)
}
return ''
})
var blocks = splitBlocks(body.replace(TRIM_TRAIL, ''))

@@ -700,3 +700,3 @@

var version = 'v3.1.1'
var version = 'v3.1.2'

@@ -703,0 +703,0 @@ export default {

@@ -131,3 +131,3 @@

* Compiler for riot custom tags
* @version v3.1.1
* @version v3.1.2
*/

@@ -642,9 +642,2 @@ var compile = (function () {

body = body.replace(STYLES, function (_m, _attrs, _style) {
if (included('css')) {
styles += (styles ? ' ' : '') + cssCode(_style, opts, _attrs, url, tagName)
}
return ''
})
body = body.replace(SCRIPTS, function (_m, _attrs, _script) {

@@ -659,2 +652,9 @@ if (included('js')) {

body = body.replace(STYLES, function (_m, _attrs, _style) {
if (included('css')) {
styles += (styles ? ' ' : '') + cssCode(_style, opts, _attrs, url, tagName)
}
return ''
})
var blocks = splitBlocks(body.replace(TRIM_TRAIL, ''))

@@ -704,3 +704,3 @@

js: compileJS,
version: 'v3.1.1'
version: 'v3.1.2'
}

@@ -707,0 +707,0 @@ return compile

@@ -253,9 +253,9 @@ # Compiler Guide (complement, WIP)

Then, one at the time, removes the `style` blocks and sends its content to the CSS parser. Next, it does the same for the `script` blocks.
Then, one at the time, removes all the `script` blocks and sends its content to the JS parser. Next, it does the same for the `style` blocks.
In the remaining content, looks for the last html tag which _terminate its line_.
If found, its closing tag signals the end of the html markup and the beginning of the untagged JavaScript code.
If found, this closing tag signals the end of the html markup and the beginning of the untagged JavaScript code.
If not found, all remaining is considered JavaScript.
So, you can put `style` and `script` blocks anywhere in the content, the only restriction is that the untagged JavaScript block must follow the html and you can't use JavaScript comments outside this block.
So, you can put `style` and `script` blocks anywhere in the content, the only restriction is that the untagged JavaScript block must be last and you can't use JavaScript comments outside this block.

@@ -262,0 +262,0 @@ **Note:** This freedom has a cost: JavaScript strings containing script or style tags have to be written with tricks as:

/**
* The riot-compiler v3.1.1
* The riot-compiler v3.1.2
*
* @module compiler
* @version v3.1.1
* @version v3.1.2
* @license MIT

@@ -933,9 +933,2 @@ * @copyright Muut Inc. + contributors

body = body.replace(STYLES, function (_m, _attrs, _style) {
if (included('css')) {
styles += (styles ? ' ' : '') + cssCode(_style, opts, _attrs, url, tagName)
}
return ''
})
body = body.replace(SCRIPTS, function (_m, _attrs, _script) {

@@ -951,2 +944,9 @@ if (included('js')) {

body = body.replace(STYLES, function (_m, _attrs, _style) {
if (included('css')) {
styles += (styles ? ' ' : '') + cssCode(_style, opts, _attrs, url, tagName)
}
return ''
})
var blocks = splitBlocks(body.replace(TRIM_TRAIL, ''))

@@ -1002,3 +1002,3 @@

parsers: parsers,
version: 'v3.1.1'
version: 'v3.1.2'
}
{
"name": "riot-compiler",
"version": "3.1.1",
"version": "3.1.2",
"description": "Compiler for riot .tag files",

@@ -35,8 +35,8 @@ "main": "lib/compiler.js",

"devDependencies": {
"coveralls": "^2.11.14",
"eslint": "^3.9.1",
"coveralls": "^2.11.15",
"eslint": "^3.14.0",
"expect.js": "^0.3.1",
"istanbul": "^0.4.5",
"jspreproc": "^0.2.7",
"mocha": "^3.1.2",
"mocha": "^3.2.0",
"riot-bump": "^1.0.0"

@@ -43,0 +43,0 @@ },

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc