Fix plugin int return data (#487)

* Fix plugin int return data

* clean only strings

* Increase version
This commit is contained in:
Polina Shneider 2018-11-09 20:15:49 +03:00 committed by GitHub
parent d6f85bd08d
commit 4a27dc6766
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 87 additions and 80 deletions

View file

@ -59,7 +59,7 @@
"camelcase": [2, {
"properties": "always"
}],
"newline-after-var": [1, "always"],
"newline-after-var": [1, "always"]
},
"globals":{
@ -79,10 +79,12 @@
"Module": true,
"Node": true,
"Element": true,
"DocumentFragment": true,
"Proxy": true,
"Symbol": true,
"$": true,
"_": true,
"setTimeout": true
"setTimeout": true,
"Map": true
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{
"name": "codex.editor",
"version": "2.3.0",
"version": "2.3.1",
"description": "Codex Editor. Native JS, based on API and Open Source",
"main": "build/codex-editor.js",
"scripts": {

View file

@ -114,8 +114,13 @@ export default class Sanitizer extends Module {
} else {
/**
* Primitives (number|string|boolean): clean this item
*
* Clean only strings
*/
return this.cleanOneItem(dataToSanitize, rules);
if (typeof dataToSanitize === 'string') {
return this.cleanOneItem(dataToSanitize, rules);
}
return dataToSanitize;
}
}
@ -123,10 +128,10 @@ export default class Sanitizer extends Module {
* Cleans string from unwanted tags
* Method allows to use default config
*
* @param {String} taintString - taint string
* @param {string} taintString - taint string
* @param {SanitizerConfig} customConfig - allowed tags
*
* @return {String} clean HTML
* @return {string} clean HTML
*/
public clean(taintString: string, customConfig: ISanitizerConfig = {}): string {