talk-message-forms
Advanced tools
Comparing version 1.1.1 to 1.2.0
(function() { | ||
var myxss, truncate, xss; | ||
var myxss, xss; | ||
xss = require('xss'); | ||
truncate = require('html-truncate'); | ||
myxss = new xss.FilterXSS({ | ||
onTagAttr: function(tag) { | ||
if (tag === 'img') { | ||
return ''; | ||
} | ||
} | ||
whiteList: [], | ||
stripIgnoreTag: true, | ||
stripIgnoreTagBody: ['script'] | ||
}); | ||
exports.parseHtml = function(html) { | ||
html = myxss.process(html).trim(); | ||
return truncate(html, 2000, { | ||
ellipsis: '...' | ||
}); | ||
return myxss.process(html).replace(/^\s+/gm, '').replace(/(?:\n+)+\n*/g, '\n').split('\n').slice(0, 5).join('\n'); | ||
}; | ||
}).call(this); |
{ | ||
"name": "talk-message-forms", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "The Message Structure and Layout of jianliao.com", | ||
@@ -10,3 +10,2 @@ "main": "lib/index.js", | ||
"highlight.js": "^8.7.0", | ||
"html-truncate": "^1.2.1", | ||
"lesshat": "^3.0.2", | ||
@@ -13,0 +12,0 @@ "react": "^0.13.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51659
11
603
- Removedhtml-truncate@^1.2.1
- Removedhtml-truncate@1.2.2(transitive)