News for hackers. Stuff that matters.
Re:Show HN: Wysihtml – Open-source rich text editor for web ... by otherusername on Thursday December 18, 2014 @10:21AM (#8767609)
Something I'd really like is a way to expose CSS styles to the editor easily. One of the major problems I always run into is that my customers try to make things look like the rest of the website by hacking the text a bit.

They'll see a highlighted word or sentence with a bold font, wider spacing and a blue background. So they set the background blue, the font bold and the spacing wider. But really, the editor should provide an intuitive way to apply the <span class="highlight"> element.

Some editors out there do this, but they generally suck in other areas. Wysihtml seems to apply inline CSS. Can it easily apply a class too?

Re:Show HN: Wysihtml – Open-source rich text editor for web ... by olla on Thursday December 18, 2014 @10:31AM (#8767670)
It can apply classes too as you wish. You can use formatInline or formatBlock command to add inline or block elements with needed classes. An example how its done internally https://github.com/Voog/wysihtml/blob/master/src/commands/fo...