Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

eleventy filter newlines

// 11ty => Filter out Newline characters in a template:
eleventyConfig.addFilter('nl2br', function(str) {
	return str.replace(/
|
|
/g, '<br />')
});

// USAGE IN A TEMPLATE: {{ some_data | nl2br }}
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to make navbar links scroll to component react 
Javascript :: clear input field react 
Javascript :: javascript Create Objects: Constructor Function Vs Object Literal 
Javascript :: javascript Update Values of Properties 
Javascript :: javascript Symbol Properties 
Javascript :: javascript Passing Parameter as Default Values 
Javascript :: javascript WeakSets Are Not iterable 
Javascript :: convert dom object to string 
Javascript :: javascript Octal syntax is not allowed 
Javascript :: javaScript values() Method 
Javascript :: actionscript fibonacci fibonaccinumbers 
Javascript :: node js - excecute a child process and exchange message to and from 
Javascript :: code grepper temp email number and password 
Javascript :: get data notifacation realtime use ajax good 
Javascript :: npm function-memoizer 
Javascript :: regex tunisian phone number 
Javascript :: phaser rotate container facing point 
Javascript :: phaser play animation with config.js 
Javascript :: swr vs axios 
Javascript :: white for file loaded 
Javascript :: docker for node , exoress and coackraz 
Javascript :: javascript list all elements in set 
Javascript :: jquery selectors 
Javascript :: last five characters of string javascript 
Javascript :: discord js bot leave voice channel 
Javascript :: array objects 
Javascript :: vue js laravel tutorial 
Javascript :: is multiple select javascript 
Javascript :: react native activity 
Javascript :: objects in array 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =