mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
Merge branch 'devel' of https://github.com/VulcanJS/Vulcan into devel
This commit is contained in:
commit
d102044ef4
6 changed files with 20 additions and 18 deletions
|
@ -50,7 +50,7 @@
|
|||
"marked": "^0.3.9",
|
||||
"metascraper": "^1.0.6",
|
||||
"meteor-node-stubs": "^0.2.3",
|
||||
"mingo": "^0.8.1",
|
||||
"mingo": "^2.2.0",
|
||||
"moment": "^2.13.0",
|
||||
"prop-types": "^15.6.0",
|
||||
"react": "^16.2.0",
|
||||
|
|
|
@ -236,7 +236,7 @@ const queryReducer = (previousResults, action, collection, mergedTerms, listReso
|
|||
const result = collection.getParameters(mergedTerms, apolloClient);
|
||||
const { selector, options } = result;
|
||||
|
||||
const mingoQuery = Mingo.Query(selector);
|
||||
const mingoQuery = new Mingo.Query(selector);
|
||||
|
||||
// function to remove a document from a results object, used by edit and remove cases below
|
||||
const removeFromResults = (results, document) => {
|
||||
|
|
|
@ -4,7 +4,7 @@ Mongo.Collection.prototype.findInStore = function (store, selector = {}, options
|
|||
const typeName = this.options && this.options.typeName;
|
||||
const docs = _.where(store.getState().apollo.data, {__typename: typeName})
|
||||
|
||||
const mingoQuery = Mingo.Query(selector);
|
||||
const mingoQuery = new Mingo.Query(selector);
|
||||
|
||||
const cursor = mingoQuery.find(docs);
|
||||
const sortedDocs = cursor.sort(options.sort).all();
|
||||
|
|
|
@ -7,7 +7,6 @@ Utilities
|
|||
import marked from 'marked';
|
||||
import urlObject from 'url';
|
||||
import moment from 'moment';
|
||||
import sanitizeHtml from 'sanitize-html';
|
||||
import getSlug from 'speakingurl';
|
||||
import { getSetting, registerSetting } from './settings.js';
|
||||
import { Routes } from './routes.js';
|
||||
|
@ -208,20 +207,6 @@ Utils.cleanUp = function(s) {
|
|||
};
|
||||
|
||||
Utils.sanitize = function(s) {
|
||||
// console.log('// before sanitization:')
|
||||
// console.log(s)
|
||||
if(Meteor.isServer){
|
||||
s = sanitizeHtml(s, {
|
||||
allowedTags: [
|
||||
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul',
|
||||
'ol', 'nl', 'li', 'b', 'i', 'strong', 'em', 'strike',
|
||||
'code', 'hr', 'br', 'div', 'table', 'thead', 'caption',
|
||||
'tbody', 'tr', 'th', 'td', 'pre', 'img'
|
||||
]
|
||||
});
|
||||
// console.log('// after sanitization:')
|
||||
// console.log(s)
|
||||
}
|
||||
return s;
|
||||
};
|
||||
|
||||
|
|
|
@ -12,3 +12,4 @@ export * from '../modules/index.js';
|
|||
export * from './mutators.js';
|
||||
export * from './render_context.js';
|
||||
export * from './inject_data.js';
|
||||
export * from './utils.js';
|
||||
|
|
16
packages/vulcan-lib/lib/server/utils.js
Normal file
16
packages/vulcan-lib/lib/server/utils.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
import sanitizeHtml from 'sanitize-html';
|
||||
|
||||
import { Utils } from '../modules';
|
||||
|
||||
Utils.sanitize = function(s) {
|
||||
return sanitizeHtml(s, {
|
||||
allowedTags: [
|
||||
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul',
|
||||
'ol', 'nl', 'li', 'b', 'i', 'strong', 'em', 'strike',
|
||||
'code', 'hr', 'br', 'div', 'table', 'thead', 'caption',
|
||||
'tbody', 'tr', 'th', 'td', 'pre', 'img'
|
||||
]
|
||||
});
|
||||
};
|
||||
|
||||
export { Utils };
|
Loading…
Add table
Reference in a new issue