Quantcast
Channel: textarea content inside a .txt file but keep line-breaks - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by Dyrandz Famador for textarea content inside a .txt file but keep line-breaks

$
0
0

you can use replace

like this:

text = text.replace(/\n/g, "\r\n");
var data = new Blob([text], {type: 'text/plain'});

SEE DEMO


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>