Merge branch 'devel' of https://github.com/VulcanJS/Vulcan into devel

This commit is contained in:
SachaG 2018-03-19 11:59:49 +09:00
commit d102044ef4
6 changed files with 20 additions and 18 deletions

View file

@ -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",

View file

@ -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) => {

View file

@ -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();

View file

@ -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;
};

View file

@ -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';

View 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 };