Skip to content

Commit

Permalink
fixed: unit test and unpublished riot-compiler@2.4.0 in favor of riot…
Browse files Browse the repository at this point in the history
…-compiler@2.4.0
  • Loading branch information
GianlucaGuarini committed May 5, 2016
1 parent 105e812 commit ca884fd
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 38 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
20 changes: 11 additions & 9 deletions dist/es6.compiler.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Compiler for riot custom tags
* @version v2.4.0
* @version WIP
*/

import { brackets } from 'riot-tmpl'
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -517,11 +519,11 @@ function getAttrib (attribs, name) {

function unescapeHTML (str) {
return str
.replace('&', /&/g)
.replace('&lt;', /</g)
.replace('&gt;', />/g)
.replace('&quot;', /"/g)
.replace('&#039;', /'/g)
.replace(/&amp;/g, '&')
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&quot;/g, '"')
.replace(/&#039;/g, '\'')
}

function getParserOptions (attribs) {
Expand Down Expand Up @@ -681,7 +683,7 @@ function compile (src, opts, url) {
return src
}

var version = 'v2.4.0'
var version = 'WIP'

export default {
compile,
Expand Down
19 changes: 10 additions & 9 deletions dist/riot.compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -516,11 +517,11 @@ var compile = (function () {

function unescapeHTML (str) {
return str
.replace('&amp;', /&/g)
.replace('&lt;', /</g)
.replace('&gt;', />/g)
.replace('&quot;', /"/g)
.replace('&#039;', /'/g)
.replace(/&amp;/g, '&')
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&quot;/g, '"')
.replace(/&#039;/g, '\'')
}

function getParserOptions (attribs) {
Expand Down Expand Up @@ -685,7 +686,7 @@ var compile = (function () {
html: compileHTML,
css: compileCSS,
js: compileJS,
version: 'v2.4.0'
version: 'WIP'
}
return compile

Expand Down
22 changes: 12 additions & 10 deletions lib/compiler.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
/**
* The riot-compiler v2.4.0
* The riot-compiler WIP
*
* @module compiler
* @version v2.4.0
* @version WIP
* @license MIT
* @copyright Muut Inc. + contributors
*/
'use strict'
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.
Expand Down Expand Up @@ -741,11 +743,11 @@ function getAttrib (attribs, name) {
*/
function unescapeHTML (str) {
return str
.replace('&amp;', /&/g)
.replace('&lt;', /</g)
.replace('&gt;', />/g)
.replace('&quot;', /"/g)
.replace('&#039;', /'/g)
.replace(/&amp;/g, '&')
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&quot;/g, '"')
.replace(/&#039;/g, '\'')
}

/**
Expand Down Expand Up @@ -1004,5 +1006,5 @@ module.exports = {
css: compileCSS,
js: compileJS,
parsers: parsers,
version: 'v2.4.0'
version: 'WIP'
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
18 changes: 10 additions & 8 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -801,11 +803,11 @@ function getAttrib (attribs, name) {
*/
function unescapeHTML (str) {
return str
.replace('&amp;', /&/g)
.replace('&lt;', /</g)
.replace('&gt;', />/g)
.replace('&quot;', /"/g)
.replace('&#039;', /'/g)
.replace(/&amp;/g, '&')
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&quot;/g, '"')
.replace(/&#039;/g, '\'')
}

/**
Expand Down

0 comments on commit ca884fd

Please sign in to comment.