Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-combohtml

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-combohtml - npm Package Compare versions

Comparing version 0.1.15 to 0.1.16

tasks/chunk.js

3

package.json
{
"name": "grunt-combohtml",
"description": "combine build html with ssi.",
"version": "0.1.15",
"version": "0.1.16",
"homepage": "",

@@ -31,2 +31,3 @@ "author": {

"dependencies": {
"joinbuffers": "~0.1.1",
"iconv-lite": "",

@@ -33,0 +34,0 @@ "civet": ""

@@ -15,2 +15,3 @@ /*

url = require('url'),
chunkParser = require('./chunk').parse,
path = require('path');

@@ -33,2 +34,4 @@

var done = this.async();
var that = this;

@@ -95,14 +98,17 @@ var pwd = process.cwd();

'brace_style': 'expand',
'unformatted': ['a', 'sub', 'sup', 'b', 'i', 'u']
'unformatted': ['a', 'sub', 'sup', 'b', 'i', 'u','script']
});
}
if(!(chunk instanceof Buffer)){
chunk = new Buffer(chunk);
}
if(options.encoding == 'gbk'){
chunk = iconv.encode(iconv.decode(chunk, 'utf8'),'gbk');
}
fs.writeFileSync(v.dest,chunk);
chunkParser(chunk,function(chunk){
chunk = teardownChunk(chunk,options.encoding);
if(!(chunk instanceof Buffer)){
chunk = new Buffer(chunk);
}
if(options.encoding == 'gbk'){
chunk = iconv.encode(iconv.decode(chunk, 'utf8'),'gbk');
}
fs.writeFileSync(v.dest,chunk);
done();
});

@@ -115,2 +121,13 @@ });

// 传入的chunk一定是utf8的
function teardownChunk(chunk,encoding){
if(!(chunk instanceof Buffer)){
chunk = new Buffer(chunk);
}
if(encoding == 'gbk'){
chunk = iconv.encode(iconv.decode(chunk, 'utf8'),'gbk');
}
return chunk;
}
function outputVmFile(content,fp){

@@ -117,0 +134,0 @@ var ctxt = civet.juicer2vm(content);

@@ -9,3 +9,4 @@ // 'use strict';

var reg = '<!--#([a-z]+)(\\s([a-z]+)=[\'"](.+?)[\'"])* -->';
//var reg = '<!--#([a-z]+)(\\s([a-z]+)=[\'"](.+?)[\'"])* -->';
var reg = '<!--#(include)(\\s([a-z]+)=[\'"](.+?)[\'"])* -->';
var p = './xx.html';

@@ -64,2 +65,3 @@ var CTS = {};

function getContent(p){
var http_url_reg = /^.+\/http:\/([^\/].+)$/;
if(CTS[p]){

@@ -70,2 +72,5 @@ return CTS[p];

return bf.toString('utf-8');
} else if(http_url_reg.test(p)){
var f_url = p.match(http_url_reg)[1];
return '<!--#chunk url="'+f_url+'" -->';
} else {

@@ -72,0 +77,0 @@ return "<!-- " + p + " is not found! -->";

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