| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | # {textformat}
 | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-09 00:10:41 +02:00
										 |  |  | `{textformat}` is a block tag used to | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | format text. It basically cleans up spaces and special characters, and | 
					
						
							|  |  |  | formats paragraphs by wrapping at a boundary and indenting lines. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | You can set the parameters explicitly, or use a preset style. Currently, | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | "email" is the only available style. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | ## Attributes
 | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | | Attribute Name | Default          | Description                                                                            | | 
					
						
							|  |  |  | |----------------|------------------|----------------------------------------------------------------------------------------| | 
					
						
							|  |  |  | | style          | *n/a*            | Preset style                                                                           | | 
					
						
							|  |  |  | | indent         | *0*              | The number of chars to indent every line                                               | | 
					
						
							|  |  |  | | indent\_first  | *0*              | The number of chars to indent the first line                                           | | 
					
						
							|  |  |  | | indent\_char   | *(single space)* | The character (or string of chars) to indent with                                      | | 
					
						
							|  |  |  | | wrap           | *80*             | How many characters to wrap each line to                                               | | 
					
						
							|  |  |  | | wrap\_char     | *\\n*            | The character (or string of chars) to break each line with                             | | 
					
						
							|  |  |  | | wrap\_cut      | *FALSE*          | If TRUE, wrap will break the line at the exact character instead of at a word boundary | | 
					
						
							|  |  |  | | assign         | *n/a*            | The template variable the output will be assigned to                                   | | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | ## Examples
 | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | ```smarty | 
					
						
							|  |  |  | {textformat wrap=40} | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | This is bar. | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | {/textformat} | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | The above example will output: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | ``` | 
					
						
							|  |  |  | This is foo. This is foo. This is foo. | 
					
						
							|  |  |  | This is foo. This is foo. This is foo. | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | This is bar. | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | bar foo bar foo foo. bar foo bar foo | 
					
						
							|  |  |  | foo. bar foo bar foo foo. bar foo bar | 
					
						
							|  |  |  | foo foo. bar foo bar foo foo. bar foo | 
					
						
							|  |  |  | bar foo foo. bar foo bar foo foo. | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | ```smarty | 
					
						
							|  |  |  | {textformat wrap=40 indent=4} | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | This is bar. | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | {/textformat} | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | The above example will output: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | ``` | 
					
						
							|  |  |  |     This is foo. This is foo. This is | 
					
						
							|  |  |  |     foo. This is foo. This is foo. This | 
					
						
							|  |  |  |     is foo. | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  |     This is bar. | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  |     bar foo bar foo foo. bar foo bar foo | 
					
						
							|  |  |  |     foo. bar foo bar foo foo. bar foo | 
					
						
							|  |  |  |     bar foo foo. bar foo bar foo foo. | 
					
						
							|  |  |  |     bar foo bar foo foo. bar foo bar | 
					
						
							|  |  |  |     foo foo. | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ```smarty | 
					
						
							|  |  |  | {textformat wrap=40 indent=4 indent_first=4} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This is bar. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {/textformat} | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | The above example will output: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | ``` | 
					
						
							|  |  |  |    This is foo. This is foo. This | 
					
						
							|  |  |  |    is foo. This is foo. This is foo. | 
					
						
							|  |  |  |    This is foo. | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  |    This is bar. | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  |    bar foo bar foo foo. bar foo bar | 
					
						
							|  |  |  |    foo foo. bar foo bar foo foo. bar | 
					
						
							|  |  |  |    foo bar foo foo. bar foo bar foo | 
					
						
							|  |  |  |    foo. bar foo bar foo foo. bar foo | 
					
						
							|  |  |  |    bar foo foo. | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  |        | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | ```smarty | 
					
						
							|  |  |  | {textformat style="email"} | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							|  |  |  | This is foo. | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | This is bar. | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							|  |  |  | bar foo bar foo     foo. | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | {/textformat} | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | The above example will output: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | ``` | 
					
						
							|  |  |  | This is foo. This is foo. This is foo. This is foo. This is foo. This is | 
					
						
							|  |  |  | foo. | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | This is bar. | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo | 
					
						
							|  |  |  | bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo | 
					
						
							|  |  |  | foo. | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  |       | 
					
						
							| 
									
										
										
										
											2021-12-03 11:59:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-06 14:42:31 +01:00
										 |  |  | See also [`{strip}`](../language-builtin-functions/language-function-strip.md) and | 
					
						
							|  |  |  | [`wordwrap`](../language-modifiers/language-modifier-wordwrap.md). |