sstur / draft-js-utils

DraftJS: import/export ContentState to and from HTML/Markdown
ISC License
883 stars 234 forks source link

A way to add CSS classes to HTML tags #248

Closed agjs closed 2 years ago

agjs commented 2 years ago

Hi there and thanks for all the effort you've put into this library. Draftjs would be practically useless without it.

I wonder if there's a simple way to add some sort of CSS class mapping, something like e.g.

{
'paragraph': 'some class',
'heading-one': 'some class'
}

If not, what would be the most effective way to "decorate" the HTML with classes using stateToHTML.

Thanks a bunch!