Preserve Both Spaces And Line Breaks In Your Paragraphs – Pre.js

Category: Javascript , Text | October 7, 2018
Author: renjithvk
Views Total: 1,066
Official Page: Go to website
Last Update: October 7, 2018
License: MIT

Preview:

Preserve Both Spaces And Line Breaks In Your Paragraphs – Pre.js

Description:

Pre.js is a minimal JavaScript plugin to preserve both spaces and line breaks in your paragraphs just like the <pre> element.

How to use it:

Included pre.js in your webpage.

<script src="src/js/pre.js"></script>

The example text.

<p class="pre">
  Apple
  Mango
  Orange
  Papaya
</p>

Initialize the pre.js with some options.

new Pre({
    // Default options
    el: '.pre',
    spaces: true,
    newline: true
});

Changelog:

v1.4.7 (10/07/2018)

  • Block scope fix

You Might Be Interested In:


Leave a Reply