mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	Support allowing classes
Otherwise `<input class="form-control">` can't work
This commit is contained in:
		
				
					committed by
					
						 Julian Lam
						Julian Lam
					
				
			
			
				
	
			
			
			
						parent
						
							581211e12f
						
					
				
				
					commit
					8c314fe461
				
			| @@ -33,6 +33,9 @@ let sanitizeConfig = { | ||||
| 		'draggable', 'dropzone', 'hidden', 'id', 'lang', 'spellcheck', 'style', | ||||
| 		'tabindex', 'title', 'translate', 'aria-expanded', 'data-*', | ||||
| 	], | ||||
| 	allowedClasses: { | ||||
| 		...sanitize.defaults.allowedClasses, | ||||
| 	}, | ||||
| }; | ||||
|  | ||||
| module.exports = function (Posts) { | ||||
| @@ -105,7 +108,9 @@ module.exports = function (Posts) { | ||||
|  | ||||
| 	Posts.sanitize = function (content) { | ||||
| 		return sanitize(content, { | ||||
| 			allowedTags: sanitizeConfig.allowedTags, allowedAttributes: sanitizeConfig.allowedAttributes, | ||||
| 			allowedTags: sanitizeConfig.allowedTags, | ||||
| 			allowedAttributes: sanitizeConfig.allowedAttributes, | ||||
| 			allowedClasses: sanitizeConfig.allowedClasses, | ||||
| 		}); | ||||
| 	}; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user