mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
fix: array access error when token.map is null, fix #3123
This commit is contained in:
8
tests/fixtures/markdowns.js
vendored
8
tests/fixtures/markdowns.js
vendored
@@ -104,6 +104,11 @@ Term 2 with *inline markup*
|
||||
`
|
||||
const shortcuts = '<kbd>Ctrl</kbd>\n\n[[Ctrl]]'
|
||||
|
||||
const footnote = `
|
||||
^[hello-world]
|
||||
hello-world: https://github.com/BoostIO/Boostnote/
|
||||
`
|
||||
|
||||
export default {
|
||||
basic,
|
||||
codeblock,
|
||||
@@ -115,5 +120,6 @@ export default {
|
||||
subTexts,
|
||||
supTexts,
|
||||
deflists,
|
||||
shortcuts
|
||||
shortcuts,
|
||||
footnote
|
||||
}
|
||||
|
||||
@@ -68,3 +68,8 @@ test('Markdown.render() should render shortcuts correctly', t => {
|
||||
const rendered = md.render(markdownFixtures.shortcuts)
|
||||
t.snapshot(rendered)
|
||||
})
|
||||
|
||||
test('Markdown.render() should render footnote correctly', t => {
|
||||
const rendered = md.render(markdownFixtures.footnote)
|
||||
t.snapshot(rendered)
|
||||
})
|
||||
|
||||
@@ -4,6 +4,21 @@ The actual snapshot is saved in `markdown-test.js.snap`.
|
||||
|
||||
Generated by [AVA](https://ava.li).
|
||||
|
||||
## Markdown.render() should render footnote correctly
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
`<p data-line="1"><sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup><br />␊
|
||||
hello-world: <a href="https://github.com/BoostIO/Boostnote/">https://github.com/BoostIO/Boostnote/</a></p>␊
|
||||
<hr class="footnotes-sep" />␊
|
||||
<section class="footnotes">␊
|
||||
<ol class="footnotes-list">␊
|
||||
<li id="fn1" class="footnote-item"><p>hello-world <a href="#fnref1" class="footnote-backref">↩︎</a></p>␊
|
||||
</li>␊
|
||||
</ol>␊
|
||||
</section>␊
|
||||
`
|
||||
|
||||
## Markdown.render() should render line breaks correctly
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user