@warren-bank/cartamd-plugin-newline-break
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Carta Plugin: Newline Break

This plugin adds support for hard breaks without needing spaces or escapes (turns carriage returns into <br>s).

Markdown already has two ways to include hard breaks, namely trailing spaces and escapes (note that represents a normal space):

lorem␠␠
ipsum

lorem\
ipsum

Both will turn into <br>s. If you control who authors content or can document how markdown works, it's recommended to use escapes instead.

Install

  npm install --save @warren-bank/cartamd-plugin-newline-break

Usage with Svelte

  <script lang="ts">
    import {Carta, MarkdownEditor} from 'carta-md'
    import {newline_break} from '@warren-bank/cartamd-plugin-newline-break'

    import 'carta-md/default.css'

    const carta = new Carta({
      extensions: [
        newline_break()
      ]
    })

    let value
  </script>

  <MarkdownEditor bind:value {carta} />

Legal:

Package Sidebar

Install

npm i @warren-bank/cartamd-plugin-newline-break

Weekly Downloads

0

Version

1.0.0

License

GPL-2.0

Unpacked Size

21.6 kB

Total Files

6

Last publish

Collaborators

  • warren-r-bank