mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[1.8.x] Updated docstring for firstof tag to reflect new auto-escaping behavior.
Backport of a1842e3299 from master
			
			
This commit is contained in:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						parent
						
							dcf2bbf0f0
						
					
				
				
					commit
					7ae7600d2b
				
			| @@ -770,11 +770,15 @@ def firstof(parser, token): | |||||||
|  |  | ||||||
|         {% firstof var1 var2 var3 "fallback value" %} |         {% firstof var1 var2 var3 "fallback value" %} | ||||||
|  |  | ||||||
|     If you want to escape the output, use a filter tag:: |     If you want to disable auto-escaping of variables you can use:: | ||||||
|  |  | ||||||
|         {% filter force_escape %} |         {% autoescape off %} | ||||||
|             {% firstof var1 var2 var3 "fallback value" %} |             {% firstof var1 var2 var3 "<strong>fallback value</strong>" %} | ||||||
|         {% endfilter %} |         {% autoescape %} | ||||||
|  |  | ||||||
|  |     Or if only some variables should be escaped, you can use:: | ||||||
|  |  | ||||||
|  |         {% firstof var1 var2|safe var3 "<strong>fallback value</strong>"|safe %} | ||||||
|  |  | ||||||
|     """ |     """ | ||||||
|     bits = token.split_contents()[1:] |     bits = token.split_contents()[1:] | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user