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

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

Open
Arieski opened this issue Sep 7, 2021 · 1 comment

Comments

@Arieski
Copy link

Arieski commented Sep 7, 2021

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.

@psybor
Copy link

psybor commented Jul 22, 2022

).open(block, orderedListNumber[block.depth]);

--      ).open(block, orderedListNumber[block.depth]);
++    ).open(orderedListNumber[block.depth]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants