I am searching for long for an editor that let the user to change style attribute like border
, padding
, and margin
I tested lot of editors, and didn't find. Do you know about editor, that support it?
Editor I tested, and didn't have those buttons (maybe there are but I didn't see)
https://github.com/Voog/wysihtml has functionality for changing style attributes on block and inline(or inline block) elements separately.
Look at tests for examples: Adding styles with formatInline command (applies on selected text when present) https://github.com/Voog/wysihtml/blob/master/test/commands/formatInline_test.js#L127
formatBlock has similar syntax but is meant to insert/change block level elements. (applies on closest block level element when present)
Unfortunately it does not have a functionality to change the style automatically picking inline or block method. The problem is that it is very difficult to know what elements user intended to pick with a selection.
Also currently editor does not guarantee minimal tag wrapping when using styles. Additional <span>
s or <div>
s might be created depending on selection.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.