Skip to content

[solution] ordered list item num displayed as “[object Object]” when export as markdown #6

@Arieski

Description

@Arieski

Bug found and solution

@brilliant-js

When you decide to export as markdown, you may found the ordered list items are not displayed properly.
【当选择以markdown导出的时候,有序列表的序号可能无法正常显示。】

If you get 【如果导出时显示】

[object Object]. 1111
[object Object]. 2222

instead of 【而不是】

1. 1111
2. 2222

Here is how to fix it.

  1. locate the file PROJECT_DIR\node_modules\brilliant-editor\dist\brilliant-editor.cjs.development.js
  2. locate the line 4712 markdownString += (customStyleItems[type] || StyleItems[type]).open(block, orderedListNumber[block.depth]);
  3. change it to markdownString += (customStyleItems[type] || StyleItems[type]).open(orderedListNumber[block.depth]);

【解决方法如下】

  1. 找到文件: 项目目录\node_modules\brilliant-editor\dist\brilliant-editor.cjs.development.js
  2. 定位第4712行:markdownString += (customStyleItems[type] || StyleItems[type]).open(block, orderedListNumber[block.depth]);
  3. 讲第4712行改为: markdownString += (customStyleItems[type] || StyleItems[type]).open(orderedListNumber[block.depth]);

Hope this post could help you. Happy hacking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions