editor-js / list

Advanced List tool for the Editor.js.
MIT License
48 stars 47 forks source link

Adding the option to change the default list style via the config, de… #31

Closed sethmichaelbrown closed 1 year ago

sethmichaelbrown commented 3 years ago

…faulting to ordered so this is fully backwards compatible, updating the README to reflect new config options

This PR adds functionality to make the default list type variable. I added a check to ensure the type was either ordered or unordered - so long as the option passed via the config.defaultListStyle is one of these valid options, it is considered the default style. If it is not a valid option, or does not exist, the fallback is ordered so that it is fully backwards compatible.

The README as been updated to reflect this change.

Per the comments on other PRs, this code has been linted with ESLint. I did not see any style linting rules such a .prettierrc so I did the style linting by hand. Please ensure it matches the code base style to your liking - if not, please let me know how to improve it. Thanks.

JackWCollins commented 3 years ago

This would be very useful to us - thanks for writing @sethmichaelbrown!

cam-perry commented 2 years ago

+1 to this. @editorjs/list supports a config: { defaultStyle: "unordered" } so it would be ideal to have the same config when switching over to this tool.

robonetphy commented 1 year ago

@sethmichaelbrown thanks for the PR, but this feature is updated via #50