Skip to content

Commit

Permalink
v2.3.21
Browse files Browse the repository at this point in the history
  • Loading branch information
amarcruz committed Jan 14, 2016
1 parent e70d96d commit aae998d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 30 deletions.
20 changes: 8 additions & 12 deletions dist/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,10 @@ var

VOID_TAGS = /^(?:input|img|br|wbr|hr|area|base|col|embed|keygen|link|meta|param|source|track)$/,

HTML_ATTR = / ?([-\w:\xA0-\xFF]+) ?(?:= ?('[^']*?'|"[^"]*?"|\S+))?/g,
HTML_ATTR = / ?([-\w:\xA0-\xFF]+) ?(?:= ?('[^']*'|"[^"]*"|\S+))?/g,
SPEC_TYPES = /^"(?:number|date(?:time)?|time|month|email|color)\b/i,
TRIM_TRAIL = /[ \t]+$/gm,
S_STRINGS = /"(?:[^"\n\\]*|\\[\S\s])*"|'(?:[^'\n\\]*|\\[\S\s])*'/.source
S_STRINGS = /"[^"\n\\]*(?:\\[\S\s][^"\n\\]*)*"|'[^'\n\\]*(?:\\[\S\s][^'\n\\]*)*'/.source

var path = require('path')

Expand Down Expand Up @@ -632,7 +632,7 @@ function _compileCSS (style, tag, type, opts) {

// istanbul ignore next
function compileCSS (style, parser, opts) {
if (typeof parser === 'object') {
if (parser && typeof parser === 'object') {
opts = parser
parser = ''
}
Expand Down Expand Up @@ -677,17 +677,13 @@ function getCode (code, opts, attrs, url) {
var type = getType(attrs),
parserOpts = getParserOptions(attrs)

// istanbul ignore else
if (url) {
var src = getAttr(attrs, 'src')
var src = getAttr(attrs, 'src')

if (src) {
var
charset = getAttr(attrs, 'charset'),
file = path.resolve(path.dirname(url), src)
if (src) {
var charset = getAttr(attrs, 'charset'),
file = path.resolve(path.dirname(url), src)

code = require('fs').readFileSync(file, charset || 'utf8')
}
code = require('fs').readFileSync(file, charset || 'utf8')
}
return _compileJS(code, opts, type, parserOpts, url)
}
Expand Down
6 changes: 3 additions & 3 deletions dist/es6.compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ var

VOID_TAGS = /^(?:input|img|br|wbr|hr|area|base|col|embed|keygen|link|meta|param|source|track)$/,

HTML_ATTR = / ?([-\w:\xA0-\xFF]+) ?(?:= ?('[^']*?'|"[^"]*?"|\S+))?/g,
HTML_ATTR = / ?([-\w:\xA0-\xFF]+) ?(?:= ?('[^']*'|"[^"]*"|\S+))?/g,
SPEC_TYPES = /^"(?:number|date(?:time)?|time|month|email|color)\b/i,
TRIM_TRAIL = /[ \t]+$/gm,
S_STRINGS = /"(?:[^"\n\\]*|\\[\S\s])*"|'(?:[^'\n\\]*|\\[\S\s])*'/.source
S_STRINGS = /"[^"\n\\]*(?:\\[\S\s][^"\n\\]*)*"|'[^'\n\\]*(?:\\[\S\s][^'\n\\]*)*'/.source

function q (s) {
return "'" + (
Expand Down Expand Up @@ -419,7 +419,7 @@ function _compileCSS (style, tag, type, opts) {

// istanbul ignore next
function compileCSS (style, parser, opts) {
if (typeof parser === 'object') {
if (parser && typeof parser === 'object') {
opts = parser
parser = ''
}
Expand Down
6 changes: 3 additions & 3 deletions dist/riot.compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ var compile = (function () {

VOID_TAGS = /^(?:input|img|br|wbr|hr|area|base|col|embed|keygen|link|meta|param|source|track)$/,

HTML_ATTR = / ?([-\w:\xA0-\xFF]+) ?(?:= ?('[^']*?'|"[^"]*?"|\S+))?/g,
HTML_ATTR = / ?([-\w:\xA0-\xFF]+) ?(?:= ?('[^']*'|"[^"]*"|\S+))?/g,
SPEC_TYPES = /^"(?:number|date(?:time)?|time|month|email|color)\b/i,
TRIM_TRAIL = /[ \t]+$/gm,
S_STRINGS = /"(?:[^"\n\\]*|\\[\S\s])*"|'(?:[^'\n\\]*|\\[\S\s])*'/.source
S_STRINGS = /"[^"\n\\]*(?:\\[\S\s][^"\n\\]*)*"|'[^'\n\\]*(?:\\[\S\s][^'\n\\]*)*'/.source

function q (s) {
return "'" + (
Expand Down Expand Up @@ -416,7 +416,7 @@ var compile = (function () {

// istanbul ignore next
function compileCSS (style, parser, opts) {
if (typeof parser === 'object') {
if (parser && typeof parser === 'object') {
opts = parser
parser = ''
}
Expand Down
20 changes: 8 additions & 12 deletions lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ var
VOID_TAGS = /^(?:input|img|br|wbr|hr|area|base|col|embed|keygen|link|meta|param|source|track)$/,

// Matches attributes. Names can contain almost all iso-8859-1 character set.
HTML_ATTR = / ?([-\w:\xA0-\xFF]+) ?(?:= ?('[^']*?'|"[^"]*?"|\S+))?/g,
HTML_ATTR = / ?([-\w:\xA0-\xFF]+) ?(?:= ?('[^']*'|"[^"]*"|\S+))?/g,
SPEC_TYPES = /^"(?:number|date(?:time)?|time|month|email|color)\b/i,
TRIM_TRAIL = /[ \t]+$/gm,
S_STRINGS = /"(?:[^"\n\\]*|\\[\S\s])*"|'(?:[^'\n\\]*|\\[\S\s])*'/.source
S_STRINGS = /"[^"\n\\]*(?:\\[\S\s][^"\n\\]*)*"|'[^'\n\\]*(?:\\[\S\s][^'\n\\]*)*'/.source

//#if NODE
var path = require('path')
Expand Down Expand Up @@ -421,7 +421,7 @@ function _compileCSS (style, tag, type, opts) {
*/
// istanbul ignore next
function compileCSS (style, parser, opts) {
if (typeof parser === 'object') {
if (parser && typeof parser === 'object') {
opts = parser
parser = ''
}
Expand Down Expand Up @@ -477,17 +477,13 @@ function getCode (code, opts, attrs, url) {
parserOpts = getParserOptions(attrs)

//#if NODE
// istanbul ignore else
if (url) {
var src = getAttr(attrs, 'src')
var src = getAttr(attrs, 'src')

if (src) {
var
charset = getAttr(attrs, 'charset'),
file = path.resolve(path.dirname(url), src)
if (src) {
var charset = getAttr(attrs, 'charset'),
file = path.resolve(path.dirname(url), src)

code = require('fs').readFileSync(file, charset || 'utf8')
}
code = require('fs').readFileSync(file, charset || 'utf8')
}
//#endif
return _compileJS(code, opts, type, parserOpts, url)
Expand Down

0 comments on commit aae998d

Please sign in to comment.