From decc6810c9fc1238f4dc2abc42c30c173ae2845c Mon Sep 17 00:00:00 2001 From: Gianluca Guarini Date: Thu, 5 May 2016 22:47:51 +0200 Subject: [PATCH] fixed: unit test and unpublished riot-compiler@2.4.0 in favor of riot-compiler@2.4.1 --- CHANGELOG.md | 2 +- dist/es6.compiler.js | 20 +++++++++++--------- dist/riot.compiler.js | 19 ++++++++++--------- lib/compiler.js | 22 ++++++++++++---------- package.json | 2 +- src/core.js | 18 ++++++++++-------- 6 files changed, 45 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4680ee..90d0411 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Compiler Changes -### v2.4.0 +### v2.4.1 - Add the `pug` parser (it will replace completely `jade` in the next major release) - Add the possibility to pass custom parsers options directly via the `compiler.compile` method through the `parserOptions: {js: {}, template: {}, style: {}}` key [more info](https://github.com/riot/compiler/issues/64) diff --git a/dist/es6.compiler.js b/dist/es6.compiler.js index afa2a25..bc56770 100644 --- a/dist/es6.compiler.js +++ b/dist/es6.compiler.js @@ -1,6 +1,6 @@ /** * Compiler for riot custom tags - * @version v2.4.0 + * @version WIP */ import { brackets } from 'riot-tmpl' @@ -111,9 +111,11 @@ var parsers = (function () { /** * @module compiler */ -var extend -extend = parsers.utils.extend +/* eslint-disable */ + +var extend = parsers.utils.extend +/* eslint-enable */ var S_LINESTR = /"[^"\n\\]*(?:\\[\S\s][^"\n\\]*)*"|'[^'\n\\]*(?:\\[\S\s][^'\n\\]*)*'/.source @@ -517,11 +519,11 @@ function getAttrib (attribs, name) { function unescapeHTML (str) { return str - .replace('&', /&/g) - .replace('<', //g) - .replace('"', /"/g) - .replace(''', /'/g) + .replace(/&/g, '&') + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/"/g, '"') + .replace(/'/g, '\'') } function getParserOptions (attribs) { @@ -681,7 +683,7 @@ function compile (src, opts, url) { return src } -var version = 'v2.4.0' +var version = 'WIP' export default { compile, diff --git a/dist/riot.compiler.js b/dist/riot.compiler.js index 83dad5f..75bac74 100644 --- a/dist/riot.compiler.js +++ b/dist/riot.compiler.js @@ -106,13 +106,14 @@ riot.parsers = parsers /** * Compiler for riot custom tags - * @version v2.4.0 + * @version WIP */ var compile = (function () { - var extend + /* eslint-disable */ - extend = parsers.utils.extend + var extend = parsers.utils.extend + /* eslint-enable */ var S_LINESTR = /"[^"\n\\]*(?:\\[\S\s][^"\n\\]*)*"|'[^'\n\\]*(?:\\[\S\s][^'\n\\]*)*'/.source @@ -516,11 +517,11 @@ var compile = (function () { function unescapeHTML (str) { return str - .replace('&', /&/g) - .replace('<', //g) - .replace('"', /"/g) - .replace(''', /'/g) + .replace(/&/g, '&') + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/"/g, '"') + .replace(/'/g, '\'') } function getParserOptions (attribs) { @@ -685,7 +686,7 @@ var compile = (function () { html: compileHTML, css: compileCSS, js: compileJS, - version: 'v2.4.0' + version: 'WIP' } return compile diff --git a/lib/compiler.js b/lib/compiler.js index ef336a3..f78bda7 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -1,8 +1,8 @@ /** - * The riot-compiler v2.4.0 + * The riot-compiler WIP * * @module compiler - * @version v2.4.0 + * @version WIP * @license MIT * @copyright Muut Inc. + contributors */ @@ -10,8 +10,10 @@ var brackets = require('./brackets') var parsers = require('./parsers') var path = require('path') -var extend -extend = require('./parsers/_utils').mixobj + +/* eslint-disable */ +var extend = require('./parsers/_utils').mixobj +/* eslint-enable */ /** * Source for creating regexes matching valid quoted, single-line JavaScript strings. @@ -741,11 +743,11 @@ function getAttrib (attribs, name) { */ function unescapeHTML (str) { return str - .replace('&', /&/g) - .replace('<', //g) - .replace('"', /"/g) - .replace(''', /'/g) + .replace(/&/g, '&') + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/"/g, '"') + .replace(/'/g, '\'') } /** @@ -1004,5 +1006,5 @@ module.exports = { css: compileCSS, js: compileJS, parsers: parsers, - version: 'v2.4.0' + version: 'WIP' } diff --git a/package.json b/package.json index d1cbbc3..26927a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "riot-compiler", - "version": "2.4.0", + "version": "2.4.1", "description": "Compiler for riot .tag files", "main": "lib/compiler.js", "jsnext:main": "dist/es6.compiler.js", diff --git a/src/core.js b/src/core.js index 1ed945b..fb73e95 100644 --- a/src/core.js +++ b/src/core.js @@ -12,13 +12,15 @@ var brackets = require('./brackets') var parsers = require('./parsers') var path = require('path') // used by getCode() //#endif -var extend + +/* eslint-disable */ //#if NODE -extend = require('./parsers/_utils').mixobj +var extend = require('./parsers/_utils').mixobj //#else // shortcut to enable the use of the parsers util methods -extend = parsers.utils.extend +var extend = parsers.utils.extend //#endif +/* eslint-enable */ //#set $_RIX_TEST = 4 //#ifndef $_RIX_TEST @@ -801,11 +803,11 @@ function getAttrib (attribs, name) { */ function unescapeHTML (str) { return str - .replace('&', /&/g) - .replace('<', //g) - .replace('"', /"/g) - .replace(''', /'/g) + .replace(/&/g, '&') + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/"/g, '"') + .replace(/'/g, '\'') } /**