mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Merge pull request #1887 from o-3/master
Add configuration to render newlines as <br> or not
This commit is contained in:
5
tests/fixtures/markdowns.js
vendored
5
tests/fixtures/markdowns.js
vendored
@@ -48,10 +48,13 @@ const checkboxes = `
|
||||
|
||||
const smartQuotes = 'This is a "QUOTE".'
|
||||
|
||||
const breaks = 'This is the first line.\nThis is the second line.'
|
||||
|
||||
export default {
|
||||
basic,
|
||||
codeblock,
|
||||
katex,
|
||||
checkboxes,
|
||||
smartQuotes
|
||||
smartQuotes,
|
||||
breaks
|
||||
}
|
||||
|
||||
@@ -34,3 +34,12 @@ test('Markdown.render() should text with quotes correctly', t => {
|
||||
const renderedNonSmartQuotes = newmd.render(markdownFixtures.smartQuotes)
|
||||
t.snapshot(renderedNonSmartQuotes)
|
||||
})
|
||||
|
||||
test('Markdown.render() should render line breaks correctly', t => {
|
||||
const renderedBreaks = md.render(markdownFixtures.breaks)
|
||||
t.snapshot(renderedBreaks)
|
||||
|
||||
const newmd = new Markdown({ breaks: false })
|
||||
const renderedNonBreaks = newmd.render(markdownFixtures.breaks)
|
||||
t.snapshot(renderedNonBreaks)
|
||||
})
|
||||
|
||||
@@ -4,6 +4,20 @@ The actual snapshot is saved in `markdown-test.js.snap`.
|
||||
|
||||
Generated by [AVA](https://ava.li).
|
||||
|
||||
## Markdown.render() should render line breaks correctly
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
`<p data-line="0">This is the first line.<br />␊
|
||||
This is the second line.</p>␊
|
||||
`
|
||||
|
||||
> Snapshot 2
|
||||
|
||||
`<p data-line="0">This is the first line.␊
|
||||
This is the second line.</p>␊
|
||||
`
|
||||
|
||||
## Markdown.render() should renders KaTeX correctly
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user