mirror of
				https://github.com/redmine/redmine.git
				synced 2025-10-31 10:25:55 +01:00 
			
		
		
		
	Patch by Jens Krämer. git-svn-id: https://svn.redmine.org/redmine/trunk@21900 e93f8b46-1217-0410-a6f0-8f06a7374b81
		
			
				
	
	
		
			21 lines
		
	
	
		
			433 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			433 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| module Redmine
 | |
|   module WikiFormatting
 | |
| 
 | |
|     # Combination of SanitizationFilter and ExternalLinksFilter
 | |
|     class HtmlSanitizer
 | |
| 
 | |
|       Pipeline = HTML::Pipeline.new([
 | |
|         Redmine::WikiFormatting::CommonMark::SanitizationFilter,
 | |
|         Redmine::WikiFormatting::CommonMark::ExternalLinksFilter,
 | |
|       ], {})
 | |
| 
 | |
|       def self.call(html)
 | |
|         result = Pipeline.call html
 | |
|         result[:output].to_s
 | |
|       end
 | |
|     end
 | |
| 
 | |
|   end
 | |
| end
 | |
| 
 |