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

[Bug]: Orderlist nested not right #6158

Open
liangxiwei opened this issue Mar 4, 2025 · 0 comments
Open

[Bug]: Orderlist nested not right #6158

liangxiwei opened this issue Mar 4, 2025 · 0 comments
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@liangxiwei
Copy link

liangxiwei commented Mar 4, 2025

Affected Packages

core,StarterKit

Version(s)

2.11.5

Bug Description

the md text is :

### ▶ 地球线:飞行员E的觉醒
1. **陨石坠落事件(1977)**
   - 苏联军事基地发现外星机器人残骸
   - 秘密科研小组发现矿石的平行宇宙能量特性

2. **2012倒计时启动**
   - E接收外星信息时的量子纠缠现象描写
   - 政府「方舟计划」与民间「末日派」冲突

and the preview is

Image

The extension code is

export const BaseExtension = [
  CodeBlockStyles,
  Typography,
  StarterKit.configure({
    codeBlock: false,
    paragraph: {
      HTMLAttributes: {
        class: 'py-2',
      },
    },
    bulletList: {
      HTMLAttributes: {
        class: 'list-disc pl-6',
      },
    },
    orderedList: {
      HTMLAttributes: {
        class: 'list-decimal pl-8',
      },
    },
    blockquote: {
      HTMLAttributes: {
        class: 'pl-2.5 border-l-4 border-gray-200',
      },
    },
    horizontalRule: {
      HTMLAttributes: {
        class: 'my-4',
      },
    },
  }),
  HeadingStyles,
  Link.configure({
    openOnClick: true,
    HTMLAttributes: {
      class: 'text-active_color underline underline-offset-4 mx-0.5',
    },
  }),
  TaskList,
  TaskItem.configure({
    nested: true,
  }),
  Table.configure({
    resizable: false,
    HTMLAttributes: {
      class: 'border-collapse w-full',
    },
  }),
  TableRow.configure({
    HTMLAttributes: {
      class: 'border-b',
    },
  }),
  TableHeader.configure({
    HTMLAttributes: {
      class: 'border p-2',
    },
  }),
  TableCell.configure({
    HTMLAttributes: {
      class: 'border p-2',
      align: 'center',
    },
  }),
  Image.extend({
    addAttributes() {
      const attrs = this.parent?.() || {};

      return {
        ...attrs,
        width: {
          default: null,
          parseHTML: (el) => el.getAttribute('width'),
          renderHTML: (attrs) => (attrs.width ? { width: attrs.width } : {}),
        },
      };
    },
  }).configure({
    HTMLAttributes: {
      class: 'rounded-lg inline-block',
    },
    inline: true,
  }),
];```

### Browser Used

Chrome

### Code Example URL

_No response_

### Expected Behavior

the preview is corect

### Additional Context (Optional)

_No response_

### Dependency Updates

- [x] Yes, I've updated all my dependencies.
@liangxiwei liangxiwei added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Mar 4, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Tiptap: Issues Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
Status: Needs Triage
Development

No branches or pull requests

1 participant