@warren-bank/cartamd-plugin-newline-break
v1.0.0
Published
Collection of plugins for the 'BearToCode/carta' markdown editor.
Downloads
5
Maintainers
Readme
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:
- copyright: Warren Bank
- license: GPL-2.0