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

I can't use unorderedListItemPrefix for orderedList #304

Open
willyou opened this issue Oct 21, 2023 · 2 comments
Open

I can't use unorderedListItemPrefix for orderedList #304

willyou opened this issue Oct 21, 2023 · 2 comments

Comments

@willyou
Copy link

willyou commented Oct 21, 2023

Hello there, I want to remove the ordered list prefix item:
Turn this

1. abc
2. abcd
3. abcde

into

abc
abcd
abcde

I tried to use

  1. the formatter to achieve what I wanted but had no luck.
  2. selectors: [ { selector: 'ol', options: { itemPrefix: ' ' } } ]

selector ul will work, but ol won't work.
This worked for me.

selectors: [ { selector: 'ol', options: { itemPrefix: '  ' } } ]

So I am wondering is it supported already? Or, is there any workaround I can follow to achieve my goal?

@KillyMXI
Copy link
Member

As per Readme, itemPrefix is only taken into account by unorderedList default formatter.

orderedList formatter has no own options and only looks into index type attribute of HTML element.
I'll consider adding some options to orderedList formatter in the future.

To get what you want, you can assign a different formatter to ol selector.

  • adding format: 'unorderedList' to ol selector should work and allow the use of itemPrefix (not intended use but simple enough);
  • or you can define a custom formatter, albeit in this case it would require copying a significant chunk of code responsible for list formatting that is not exposed.

@willyou
Copy link
Author

willyou commented Oct 23, 2023

Thank you for the quick reply; it worked! Thank you!

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