pavittarx / editorjs-html

A javascript library to parse editorjs clean data to html. It is adaptable and usable in all kind of projects.
https://runkit.com/pavittarx/editorjs-html-example
MIT License
331 stars 61 forks source link

Unnecessary white spaces for before/after HTML tags #15

Closed georgelemon closed 3 years ago

georgelemon commented 3 years ago

Hey, I'm using this in order to achieve a stats bar that will show how many lines, words, chars and spaces a document contains and I realized that there are some extra unnecessary white spaces in your code.

I suggest to remove the white spaces before/after HTML tags for all your default transforms.

Also, transforming the delimiter can be a good idea to be hr instead of br

pavittarx commented 3 years ago

@georgelemon whitespaces were added for code readability. However, has been removed.

delimiter will remain br for code consistency, and to be in-line with previous versions. However, you can always override defaults with your own.

https://github.com/pavittarx/editorjs-html#extend-for-custom-blocks

Change type to field you want to override. For example {type: 'delimiter'} in your case.