Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fail to convert list having blockQuote with spaces to wysiwyg #1792

Merged
merged 2 commits into from Sep 7, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions apps/editor/src/__test__/unit/convertor.spec.ts
Expand Up @@ -316,6 +316,29 @@ describe('Convertor', () => {
assertConverting(markdown, expected);
});

it('block nodes in list', () => {
const markdown = source`
1. foo

\`\`\`
bar
\`\`\`

> bam
`;
const expected = source`
1. foo

\`\`\`
bar
\`\`\`

> bam
`;

assertConverting(markdown, expected);
});

it('soft break', () => {
const markdown = source`
foo
Expand Down
2 changes: 1 addition & 1 deletion apps/editor/src/wysiwyg/nodes/bulletList.ts
Expand Up @@ -19,7 +19,7 @@ export class BulletList extends NodeSchema {
get schema() {
return {
content: 'listItem+',
group: 'block listGroup',
group: 'block',
attrs: {
rawHTML: { default: null },
...getDefaultCustomAttrs(),
Expand Down
3 changes: 2 additions & 1 deletion apps/editor/src/wysiwyg/nodes/listItem.ts
Expand Up @@ -11,7 +11,8 @@ export class ListItem extends NodeSchema {

get schema() {
return {
content: 'paragraph listGroup*',
content: 'paragraph block*',
selectable: false,
attrs: {
task: { default: false },
checked: { default: false },
Expand Down
2 changes: 1 addition & 1 deletion apps/editor/src/wysiwyg/nodes/orderedList.ts
Expand Up @@ -15,7 +15,7 @@ export class OrderedList extends NodeSchema {
get schema() {
return {
content: 'listItem+',
group: 'block listGroup',
group: 'block',
attrs: {
order: { default: 1 },
rawHTML: { default: null },
Expand Down
2 changes: 1 addition & 1 deletion apps/editor/src/wysiwyg/nodes/paragraph.ts
Expand Up @@ -11,7 +11,7 @@ export class Paragraph extends NodeSchema {
get schema() {
return {
content: 'inline*',
group: 'block listGroup',
group: 'block',
attrs: {
...getDefaultCustomAttrs(),
},
Expand Down