Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/nodes/BulletList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import { listInputRule, toggleListCommand } from '../commands/index.ts'
* Only there we know the user is not trying to create a task list.
*/
const BulletList = TiptapBulletList.extend({
parseHTML() {
return this.parent?.()?.map((rule) => Object.assign(rule, { preserveWhitespace: true }))
},

addAttributes() {
return {
...this.parent?.(),
Expand Down
15 changes: 15 additions & 0 deletions src/tests/markdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ describe('Markdown though editor', () => {
expect(markdownThroughEditor('- foo\n- bar')).toBe('- foo\n- bar')
expect(markdownThroughEditor('- foo\n\n- bar')).toBe('- foo\n- bar')
expect(markdownThroughEditor('- foo\n\n\n- bar')).toBe('- foo\n- bar')
expect(markdownThroughEditor('- foo\n - bar')).toBe('- foo\n - bar')
expect(markdownThroughEditor('- foo\n - bar\n- baz')).toBe('- foo\n - bar\n- baz')
expect(markdownThroughEditor('- foo \n bar \n baz')).toBe('- foo \n bar \n baz')
})
test('ul - no suprious linebreak in nested lists (#8775)', ({ editor }) => {
const source = '- foo\n - bar\n- baz'
editor.commands.setContent(markdownit.render(source))
// Walk the doc: no hardBreak node should exist in outer list item's paragraph
let hasHardBreak = false
editor.state.doc.descendants((node) => {
if (node.type.name === 'hardBreak') {
hasHardBreak = true
}
})
expect(hasHardBreak).toBe(false)
})
test('ol', ({ markdownThroughEditor }) => {
expect(markdownThroughEditor('1. foo\n2. bar')).toBe('1. foo\n2. bar')
Expand Down
Loading